我尝试将其部署到Heroku,这是我尝试将其推入Heroku时收到的错误。这里是我目前遇到的错误。我看到我当前遇到的错误涉及顺风,但是我不确定该如何处理。
Running heroku-postbuild
> ecommerce@1.0.0 heroku-postbuild /tmp/build_1c2bd436
> NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
> core-js@2.6.11 postinstall /tmp/build_1c2bd436/client/node_modules/babel-runtime/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@3.6.5 postinstall /tmp/build_1c2bd436/client/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure@3.6.5 postinstall /tmp/build_1c2bd436/client/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
added 1657 packages from 798 contributors and audited 1740 packages in 45.079s
68 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
> client@0.1.0 build /tmp/build_1c2bd436/client
> npm run build:css && react-scripts build
> client@0.1.0 build:css /tmp/build_1c2bd436/client
> postcss src/Assests/tailwind.css -o src/Assests/main.css
sh: 1: postcss: not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! client@0.1.0 build:css: `postcss src/Assests/tailwind.css -o src/Assests/main.css`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the client@0.1.0 build:css 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.tYOmN/_logs/2020-09-25T00_53_01_969Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 build: `npm run build:css && react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@0.1.0 build 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.tYOmN/_logs/2020-09-25T00_53_01_990Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ecommerce@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 ecommerce@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.tYOmN/_logs/2020-09-25T00_53_02_014Z-debug.log
-----> Build failed ```
这是我在客户端的package.json
{
"name": "client","version": "0.1.0","private": true,"dependencies": {
"@testing-library/jest-dom": "^4.2.4","@testing-library/react": "^9.5.0","@testing-library/user-event": "^7.2.1","axios": "^0.20.0","http-proxy-middleware": "^1.0.5","react": "^16.13.1","react-dom": "^16.13.1","react-redux": "^7.2.1","react-router-dom": "^5.2.0","react-scripts": "3.4.3","react-stripe-checkout": "^2.6.3","redux": "^4.0.5","redux-thunk": "^2.3.0"
},"scripts": {
"start": "npm run watch:css && react-scripts start","build": "npm run build:css && react-scripts build","test": "react-scripts test","eject": "react-scripts eject","build:css": "postcss src/Assests/tailwind.css -o src/Assests/main.css","watch:css": "postcss src/Assests/tailwind.css -o src/Assests/main.css"
},"eslintConfig": {
"extends": "react-app"
},"browserslist": {
"production": [
">0.2%","not dead","not op_mini all"
],"development": [
"last 1 chrome version","last 1 firefox version","last 1 safari version"
]
},"devDependencies": {
"autoprefixer": "^9.8.6","i": "^0.3.6","postcss-cli": "^7.1.2","tailwindcss": "^1.8.9"
}
}
这是服务器端的package.json。
{
"name": "ecommerce","version": "1.0.0","description": "","main": "index.js","engines": {
"node": "14.4.0","npm": "6.14.8"
},"scripts": {
"server": "nodemon server.js","client": "npm run 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"
},"keywords": [],"author": "","license": "ISC","dependencies": {
"body-parser": "^1.19.0","concurrently": "^5.3.0","cookie-session": "^1.4.0","express": "^4.17.1","mongoose": "^5.10.7","nodemon": "^2.0.4","passport": "^0.4.1","passport-google-oauth20": "^2.0.0","stripe": "^8.100.0"
}
}
有什么建议吗? 谢谢!