Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Heroku不可能部署Enoint_Heroku_Npm - Fatal编程技术网

Heroku不可能部署Enoint

Heroku不可能部署Enoint,heroku,npm,Heroku,Npm,我一直在尝试在heroku上部署我的应用程序,但我不断收到相同的错误: -----> Node.js app detected -----> Creating runtime environment NPM_CONFIG_LOGLEVEL=error NODE_VERBOSE=false NODE_ENV=production NODE_MODULES_CACHE=true -----> Installing binar

我一直在尝试在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 I,然后运行npm start,我尝试完全重建我的package.json,我尝试完全删除heroku应用程序并重新创建一个,似乎没有任何帮助

My 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"
  }
}

您是否尝试将
node\u模块
添加到
.gitignore
文件并签入
gitignore
文件


我假设Heroku在抱怨,因为它试图安装
node\u modules
,但它已经在同一位置看到一个名为
node\u modules
的文件夹。

对不起,我读得太快了,写评论的速度更快了。您的任何依赖项都位于私有存储库中。我会删除我之前的评论。据我所知,我可以在我的本地计算机上安装所有依赖项。我的意思是,检查这一点的一种方法是尝试npm安装my package.json,但我非常确定您不会遇到任何问题。