以下是错误日志:
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 :(得分:3)
这类似于最近的issue in cloudfoundry(但同样的想法也适用于heroku)
在您的本地项目中,请确保首先忽略Class.forName(...)
:
node_modules
然后再次尝试你的heroku部署。