Я создаю приложение MERN + redux, внешний интерфейс реагирует, внутренний - node.js.
Он отлично работает на локальном хосте, но когда я пытаюсь сделать sh его на героку, у меня есть Эта проблема. Я следовал курсу Брэда Траверси о MERN, но получил его и не могу продолжить.
Это мой пакет. json
"scripts": {
"client-install": "npm install --prefix client",
"start": "node server.js",
"server": "nodemon server.js",
"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"
},
"dependencies": {
"body-parser": "^1.19.0",
"concurrently": "^5.1.0",
"express": "^4.17.1",
"mongoose": "^5.9.7"
},
"devDependencies": {
"cz-conventional-changelog": "^3.1.0",
"nodemon": "^2.0.2"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
И это ошибка сборки I получаю.
mbpdegobiaruben:MERN ShoppingList gchan$ git push heroku master
Enumerating objects: 143, done.
Counting objects: 100% (143/143), done.
Delta compression using up to 8 threads
Compressing objects: 100% (134/134), done.
Writing objects: 100% (143/143), 208.32 KiB | 5.48 MiB/s, done.
Total 143 (delta 63), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.16.2...
remote: Using default npm version: 6.14.4
remote:
remote: -----> Installing dependencies
remote: Installing node modules
remote:
remote: > core-js@2.6.11 postinstall /tmp/build_33801817cc54d90aaf94bfb41e439539/node_modules/core-js
remote: > node -e "try{require('./postinstall')}catch(e){}"
remote:
remote:
remote: > nodemon@2.0.2 postinstall /tmp/build_33801817cc54d90aaf94bfb41e439539/node_modules/nodemon
remote: > node bin/postinstall || exit 0
remote:
remote: Love nodemon? You can now support the project via the open collective:
remote: > https://opencollective.com/nodemon/donate
remote:
remote: added 419 packages in 8.418s
remote:
remote: -----> Build
remote: Running heroku-postbuild
remote:
remote: > mern-shoppinglist@1.0.0 heroku-postbuild /tmp/build_33801817cc54d90aaf94bfb41e439539
remote: > NPM_CONFIG_PRODUCTION= false npm install --prefix client && npm run build --prefix client
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! mern-shoppinglist@1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION= false npm install --prefix client && npm run build --prefix client`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the mern-shoppinglist@1.0.0 heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.O2wff/_logs/2020-04-16T05_41_17_476Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - Node version not specified in package.json
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to pacific-dawn-61320.
remote:
To https://git.heroku.com/pacific-dawn-61320.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pacific-dawn-61320.git'