У меня есть приложение React. js, которое я развернул на Heroku. Тогда у меня появляется это сообщение:
Список браузеров: caniuse-lite устарел. Пожалуйста, запустите следующую команду npm update
.
Итак, я запускаю npm update
и npm audit fix
. При повторном нажатии на Heroku я получаю эту ошибку:
Ошибка: не удается найти модуль 'response-dev-utils / getPublicUrlOrPath'
Это то, что я получил при запуске git push heroku master
:
remote: -----> Buildremote: Running build
remote:
remote: > products-management@0.1.0 build /tmp/build_3b9104b8c72e292510eb4a5bd0494704
remote: > react-scripts build
remote:
remote: internal/modules/cjs/loader.js:960
remote: throw err;
remote: ^
remote:
remote: Error: Cannot find module 'react-dev-utils/getPublicUrlOrPath'
remote: Require stack:
remote: - /tmp/build_3b9104b8c72e292510eb4a5bd0494704/node_modules/react-scripts/config/paths.js
remote: - /tmp/build_3b9104b8c72e292510eb4a5bd0494704/node_modules/react-scripts/config/env.js
remote: - /tmp/build_3b9104b8c72e292510eb4a5bd0494704/node_modules/react-scripts/scripts/build.js
remote: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
remote: at Function.Module._load (internal/modules/cjs/loader.js:840:27)
remote: at Module.require (internal/modules/cjs/loader.js:1019:19)
remote: at require (internal/modules/cjs/helpers.js:77:18)
remote: at Object.<anonymous> (/tmp/build_3b9104b8c72e292510eb4a5bd0494704/node_modules/react-scripts/config/paths.js:13:28)
remote: at Module._compile (internal/modules/cjs/loader.js:1133:30)
remote: at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
remote: at Module.load (internal/modules/cjs/loader.js:977:32)
remote: at Function.Module._load (internal/modules/cjs/loader.js:877:14)
remote: at Module.require (internal/modules/cjs/loader.js:1019:19) {
remote: code: 'MODULE_NOT_FOUND',
remote: requireStack: [
remote: '/tmp/build_3b9104b8c72e292510eb4a5bd0494704/node_modules/react-scripts/config/paths.js',
remote: '/tmp/build_3b9104b8c72e292510eb4a5bd0494704/node_modules/react-scripts/config/env.js',
remote: '/tmp/build_3b9104b8c72e292510eb4a5bd0494704/node_modules/react-scripts/scripts/build.js'
remote: ]
remote: }
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! products-management@0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the products-management@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.qnMyP/_logs/2020-05-07T07_23_33_937Z-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_modules checked into source control
remote: https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
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: ! Push rejected, failed to compile Node.js app.
remote: ! Push failed`enter code here`