2017-07-16 27 views
1

以下是错误日志:未能Heroku上部署的应用程序

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:  NPM_CONFIG_PRODUCTION=true 
remote:  NODE_VERBOSE=false 
remote:  NODE_ENV=production 
remote:  NODE_MODULES_CACHE=true 
remote: 
remote: -----> Installing binaries 
remote:  engines.node (package.json): ~6.11.0 
remote:  engines.npm (package.json): ~5.0.3 
remote:   
remote:  Resolving node version ~6.11.0 via semver.io... 
remote:  Downloading and installing node 6.11.1... 
remote:  Resolving npm version ~5.0.3 via semver.io... 
remote:  Downloading and installing npm 5.0.4 (replacing version 
3.10.10)... 
remote: 
remote: -----> Restoring cache 
remote:  Skipping cache restore (new-signature) 
remote: 
remote: -----> Building dependencies 
remote:  Prebuild detected (node_modules already exists) 
remote:  Rebuilding any native modules 
remote:  npm ERR! path 
/tmp/build_9c402097d0e7567eccf5e236dc7f0959/node_modules/jade/bin/jade.js 
remote:  npm ERR! code ENOENT 
remote:  npm ERR! errno -2 
remote:  npm ERR! syscall chmod 
remote:  npm ERR! enoent ENOENT: no such file or directory, chmod 
'/tmp/build_9c402097d0e7567eccf5e236dc7f0959/node_modules/jade/bin/jade.js' 
remote:  npm ERR! enoent This is related to npm not being able to 
find a file. 
remote:  npm ERR! enoent 
remote:   
remote:  npm ERR! A complete log of this run can be found in: 
remote:  npm ERR!  /app/.npm/_logs/2017-07-16T02_45_14_132Z- 
debug.log 
remote: 
remote: -----> Build failed 
remote:   
remote:  We're sorry this build is failing! You can troubleshoot 
common issues here: 
remote:   
remote:  Some possible problems: 
remote:   
remote:  - node_modules checked into source control 
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-harbor-25184. 
remote: 
To https://git.heroku.com/pacific-harbor-25184.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/pacific-harbor-25184.git' 

我怎样才能突破这个生成错误部署到Heroku的时候? (即使它本地工作)

+0

它在heroku本地工作,但是当我把它推到heroku高手它does not工作 – user3491207

回答

0

这类似于最近issue in cloudfoundry(但同样的想法适用于Heroku的为好)

男肯定的是,在您的本地项目,忽略node_modules第一:

echo 'node_modules' >> .gitignore 
git rm -r --cached node_modules 
git commit -m "ignore node_modules" 

然后再次尝试你的heroku部署。

+0

是的工作,但我的应用程序崩溃,当我这样做 – user3491207