Meteor build 在部署到 Heroku 时中断
Posted
技术标签:
【中文标题】Meteor build 在部署到 Heroku 时中断【英文标题】:Meteor build breaking on deployment to Heroku 【发布时间】:2016-07-22 21:26:07 【问题描述】:我没有更改任何依赖项,但是当我部署到 Heroku 时,我的构建突然中断了。有关详细信息,请参阅下面的错误消息。
-----> Fetching set buildpack https://github.com/AdmitHub/meteor-buildpack-horse.git... done
-----> Node.js app detected
-----> Installing node
-----> Installing meteor
Downloading Meteor distribution
Meteor 1.3 has been installed in your home directory (~/.meteor).
Now you need to do one of the following:
(1) Add "$HOME/.meteor" to your path, or
(2) Run this command as root:
cp "/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/1.3.0_3/mt-os.linux.x86_64/scripts/admin/launch-meteor" /usr/bin/meteor
Then to get started, take a look at 'meteor --help' or see the docs at
docs.meteor.com.
-----> Upgrading meteor to METEOR@1.2.1
Installed. Run 'meteor update --release 1.2.1' inside of a particular project
directory to update that project to Meteor 1.2.1.
-----> Bundling bundle
While removing platforms:
error: android: platform is not in this project
-----> Building Meteor with ROOT_URL: https://####.herokuapp.com
npm-container: updating npm dependencies -- scrap, open-graph, future,
react-linkify, externalify, react-modal, react-dom...
=> Errors while initializing project:
While building package npm-container:
error: couldn't install npm packages from npm-shrinkwrap: Command failed: npm
WARN package.json packages-for-meteor-npm-container@0.0.0 No description
npm WARN package.json packages-for-meteor-npm-container@0.0.0 No repository
field.
npm WARN package.json packages-for-meteor-npm-container@0.0.0 No README data
npm WARN deprecated CSSselect@0.4.1: the module is now available as
'css-select'
npm WARN deprecated CSSselect@0.7.0: the module is now available as
'css-select'
npm WARN engine escodegen@1.8.0: wanted: "node":">=0.12.0" (current:
"node":"0.10.40","npm":"1.4.28")
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
npm ERR! Error: version not found: ansi-styles@2.2.0
npm ERR! at
/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/.1.1.10.11us29f++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/lib/cache/add-named.js:125:12
npm ERR! at saved
(/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/.1.1.10.11us29f++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.13.0-79-generic
npm ERR! command
"/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/.1.1.10.11us29f++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node"
"/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/.1.1.10.11us29f++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm"
"install"
npm ERR! cwd
/tmp/build_99da0b7813d9d5f66b76750d44ec8399/####-af203ae940e85f2aa3e34bfa11a1028cc9cc7c8c/packages/npm-container/.npm/package-new-13b38xe
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! not ok code 0
npm WARN package.json packages-for-meteor-npm-container@0.0.0 No description
npm WARN package.json packages-for-meteor-npm-container@0.0.0 No repository
field.
npm WARN package.json packages-for-meteor-npm-container@0.0.0 No README data
npm WARN deprecated CSSselect@0.4.1: the module is now available as
'css-select'
npm WARN deprecated CSSselect@0.7.0: the module is now available as
'css-select'
npm WARN engine escodegen@1.8.0: wanted: "node":">=0.12.0" (current:
"node":"0.10.40","npm":"1.4.28")
npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'
npm ERR! Error: version not found: ansi-styles@2.2.0
npm ERR! at
/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/.1.1.10.11us29f++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/lib/cache/add-named.js:125:12
npm ERR! at saved
(/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/.1.1.10.11us29f++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR! at Object.oncomplete (fs.js:108:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.13.0-79-generic
npm ERR! command
"/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/.1.1.10.11us29f++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/node"
"/tmp/buildpack20160403-165-1y59l1z/meteor-j9kn/.meteor/packages/meteor-tool/.1.1.10.11us29f++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/bin/npm"
"install"
npm ERR! cwd
/tmp/build_99da0b7813d9d5f66b76750d44ec8399/#####-af203ae940e85f2aa3e34bfa11a1028cc9cc7c8c/packages/npm-container/.npm/package-new-13b38xe
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! not ok code 0
! Push rejected, failed to compile Node.js app
```
我想知道这是否可能是上周所有这些 npm 模块被删除的结果。任何方向将不胜感激。
谢谢!
【问题讨论】:
如果你在 Google 上搜索“错误:无法从 npm-shrinkwrap 安装 npm 包:命令失败:npm”,它会出现很多东西。例如这个答案:***.com/questions/31104909/… 【参考方案1】:buildpack 首先安装 Meteor 1.3,然后检查您的应用程序的要求,然后将其更改回 Meteor 1.2。更新/降级回 1.2 并不总是能正确解决依赖关系Cannot downgrade。这可能是未满足依赖节点版本要求的原因之一。您需要使用 1.3 在本地解决依赖问题,然后使用 buildpack 进行部署,或者使用安装 1.2 的 buildpack。
【讨论】:
以上是关于Meteor build 在部署到 Heroku 时中断的主要内容,如果未能解决你的问题,请参考以下文章
Angular 2/Nodejs 部署到 heroku 错误 heroku-postbuild: `ng build`
使用 bitbucket 管道部署到 heroku 的 Spring Boot gradle 项目在 build/libs/app-SNAPSHOT-plain.jar 中给出错误 no main m