当我尝试在Heroku上推送代码时,由于节点问题,构建/部署失败。
控制台日志
cd dungeon-diary
heroku buildpacks:set https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/emberjs.tgz
git push heroku master
输出控制台出错
remote: Building source:
remote:
remote: -----> emberjs app detected
remote: -----> Setting NPM_CONFIG_PRODUCTION to false to install ember-cli toolchain
remote: -----> Fetching buildpack heroku/nodejs-v98
remote: -----> Node.js detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): 10.* || >= 12
remote: engines.npm (package.json): 6.x
remote:
remote: Resolving node version 10.* || >= 12 via semver.io...
remote: Downloading and installing node 14.7.0...
remote: Unable to download node 14.7.0; does it exist?**
remote:
remote: -----> Build failed
软件包.json
"engines": {
"node": "10.* || >= 12"
},
1条答案
按热度按时间zzlelutf1#
问题是......
在日志中你可以看到,控制台自己选择了节点14.7.0,但是对于Heroku来说这是不可接受的。2所以我必须明确地写下使用哪个版本(以避免14.7.0),然后它就开始工作了:)
......对我来说很奇怪,为什么控制台选择不支持的版本:)