Я пытался развернуть свое приложение на heroku, но постоянно получаю ту же ошибку:
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 8.x...
Downloading and installing node 8.11.1...
Using default npm version: 5.6.0
-----> Restoring cache
Skipping cache restore (not-found)
-----> Building dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
npm ERR! path /tmp/build_b970b614b48136e1f3dc8a90ee8f11d9/node_modules/har-validator/bin/har-validator
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/build_b970b614b48136e1f3dc8a90ee8f11d9/node_modules/har-validator/bin/har-validator'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.wtPoJ/_logs/2018-05-02T14_48_40_930Z-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_modules checked into source control
https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
- 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
Приложение работает нормально на localhost, если я запускаю npm, а затем запускаю npm, я пытался полностью перестроить свой package.json, я пытался полностью удалить приложение heroku и воссоздать его, похоже, ничто не помогает.
Мой package.json выглядит так, максимально стандартно:
{
"name": "LAD",
"version": "1.0.0",
"description": "xxxxx",
"repository": "git://github.com/xxx/xxx-LAD",
"author": "xxxx",
"license": "xxxxx",
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "^1.18.2",
"bootstrap": "^3.3.7",
"compile-sass": "0.0.3",
"connect-ensure-login": "^0.1.1",
"connect-flash": "^0.1.1",
"cookie-parser": "^1.4.3",
"ejs": "^2.5.9",
"express": "^4.16.3",
"express-session": "^1.15.6",
"morgan": "^1.9.0",
"passport": "^0.4.0",
"passport-auth0": "^0.6.1",
"path": "^0.12.7",
"serve-favicon": "^2.5.0"
}
}