Примечание: я использовал этот же метод для развертывания примерно 3 раза, и теперь внезапно он не работает ... Заставляет меня думать, что что-то только что обновлено с heroku ???IDK
Попытка перенести мое приложение MERN Stack на heroku, но я получаю сообщение об ошибке, вот мой файл package.json:
{
"name": "jordanwebsite",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"start": "node server.js",
"server": "nodemon server.js",
"test": "echo \"Error: no test specified\" && exit 1",
"client-install": "npm install --prefix client",
"client": "npm start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run\tclient\"",
"heroku-postbuild": "cd client && NPM_CONFIG_PRODUCTION=false npm install && npm run build"
},
"author": "Jordan Harris",
"license": "ISC",
"dependencies": {
"axios": "^0.18.0",
"body-parser": "^1.18.3",
"concurrently": "^4.1.0",
"express": "^4.16.4",
"nodemon": "^1.18.9"
}
}
Вот журналы:
$ git push heroku master
Enumerating objects: 40, done.
Counting objects: 100% (40/40), done.
Delta compression using up to 8 threads
Compressing objects: 100% (38/38), done.
Writing objects: 100% (40/40), 2.39 MiB | 637.00 KiB/s, done.
Total 40 (delta 0), 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 10.x...
remote: Downloading and installing node 10.15.1...
remote: Using default npm version: 6.4.1
remote:
remote: -----> Building dependencies
remote: Installing node modules (package.json)
remote:
remote: > nodemon@1.18.9 postinstall /tmp/build_1c67c2822e7364298c69e79a4318103a/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 340 packages from 197 contributors and audited 2497 packages in
10.466s
remote: found 0 vulnerabilities
remote:
remote: Running heroku-postbuild
remote:
remote: > jordanwebsite@1.0.0 heroku-postbuild /tmp/build_1c67c2822e7364298c69e79a4318103a
remote: > cd client && NPM_CONFIG_PRODUCTION=false npm install && npm run build
remote:
remote: added 1963 packages from 688 contributors and audited 35917 packages in 45.094s
remote: found 0 vulnerabilities
remote:
remote:
remote: > client@0.1.0 build /tmp/build_1c67c2822e7364298c69e79a4318103a/client
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: Failed to minify the bundle. Error: static/js/main.4d56311f.chunk.js from Terser
remote: TypeError: Cannot read property 'minify' of undefined
remote: at compiler.run (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/react-scripts/scripts/build.js:169:23)
remote: at finalCallback (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/webpack/lib/Compiler.js:210:39)
remote: at hooks.done.callAsync.err (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/webpack/lib/Compiler.js:226:13)
remote: at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
remote: at AsyncSeriesHook.lazyCompileHook (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/tapable/lib/Hook.js:154:20)
remote: at onCompiled (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/webpack/lib/Compiler.js:224:21)
remote: at hooks.afterCompile.callAsync.err (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/webpack/lib/Compiler.js:553:14)
remote: at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
remote: at AsyncSeriesHook.lazyCompileHook (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/tapable/lib/Hook.js:154:20)
remote: at compilation.seal.err (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/webpack/lib/Compiler.js:550:30)
remote: at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
remote: at AsyncSeriesHook.lazyCompileHook (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/tapable/lib/Hook.js:154:20)
remote: at hooks.optimizeAssets.callAsync.err (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/webpack/lib/Compilation.js:1295:35)
remote: at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
remote: at AsyncSeriesHook.lazyCompileHook (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/tapable/lib/Hook.js:154:20)
remote: at hooks.optimizeChunkAssets.callAsync.err (/tmp/build_1c67c2822e7364298c69e79a4318103a/client/node_modules/webpack/lib/Compilation.js:1286:32)
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! client@0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the client@0.1.0 build 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.tUXJH/_logs/2019-02-03T01_53_57_344Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! jordanwebsite@1.0.0 heroku-postbuild: `cd client && NPM_CONFIG_PRODUCTION=false npm install && npm run build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the jordanwebsite@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.tUXJH/_logs/2019-02-03T01_53_57_358Z-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 jorrharris-website.
remote:
To https://git.heroku.com/jorrharris-website.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/jorrharris-website.git'