Javascript 尝试在Heroku上部署带尾风的MERN堆栈时生成失败
我正试图在Heroku上部署一个在前端使用tailwind的MERN stack应用程序,但它返回我“构建失败” 以下是Heroku的构建日志:Javascript 尝试在Heroku上部署带尾风的MERN堆栈时生成失败,javascript,reactjs,heroku,mern,tailwind-css,Javascript,Reactjs,Heroku,Mern,Tailwind Css,我正试图在Heroku上部署一个在前端使用tailwind的MERN stack应用程序,但它返回我“构建失败” 以下是Heroku的构建日志: sh: 1: postcss: not found npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file sh npm ERR! errno ENOENT npm ERR! web_page_react@0.1.0 build:tailwind: `postcss src/
sh: 1: postcss: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! web_page_react@0.1.0 build:tailwind: `postcss src/tailwind.css -o src/tailwind.generated.css`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the web_page_react@0.1.0 build:tailwind script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.BI6XT/_logs/2020-07-31T16_43_03_360Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web_page_react@0.1.0 prebuild: `npm run build:tailwind`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web_page_react@0.1.0 prebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.BI6XT/_logs/2020-07-31T16_43_03_389Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! web-items@1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client &&
npm run build --prefix client`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the web-items@1.0.0 heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.BI6XT/_logs/2020-07-31T16_43_03_414Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
这是my main package.json中的脚本:
{
"start": "node server",
"server": "nodemon server",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
}
{
"build:tailwind": "postcss src/tailwind.css -o src/tailwind.generated.css",
"watch:tailwind": "postcss -w src/tailwind.css -o src/tailwind.generated.css",
"start": "run-p watch:tailwind start:react",
"start:react": "react-scripts start",
"prebuild": "npm run build:tailwind",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
这是my client package.json中的脚本:
{
"start": "node server",
"server": "nodemon server",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
}
{
"build:tailwind": "postcss src/tailwind.css -o src/tailwind.generated.css",
"watch:tailwind": "postcss -w src/tailwind.css -o src/tailwind.generated.css",
"start": "run-p watch:tailwind start:react",
"start:react": "react-scripts start",
"prebuild": "npm run build:tailwind",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
}
您的
package.json
文件中似乎不存在postsss
模块
你能给我看一下你的
package.json
文件吗?我对看起来完全相同的项目设置也有同样的问题。你知道邮政编码的问题吗?谢谢。我对看起来完全相同的项目设置也有同样的问题。你知道这件事有没有解决?