【发布时间】:2015-08-05 08:09:05
【问题描述】:
您好,我正在尝试将一个 npm/bower/gulp 项目部署到 heroku,但我遇到了一个非常普遍的错误,我也在本地运行
npm ERR! Darwin 14.1.0
npm ERR! argv "node" "/Users/admin/.node/bin/npm" "install"
npm ERR! node v0.10.33
npm ERR! npm v2.1.9
npm ERR! code ELIFECYCLE
npm ERR! @ postinstall: `bower install && gulp build`
npm ERR! Exit status 1
完整的 npm-debug.log 可以在 https://gist.github.com/sjmcpherso/64be7626f37b3f296bb2 以及我的 package.json 中找到
在我的 package.json 中,我有一个 postinstall 任务,它运行“bower install”,然后运行“gulp build”,如果我单独运行它们,它们都可以正常工作
"private": true,
"engines": {
"node": ">=0.10.0"
},
"main": "server.js",
"scripts": {
"start": "node server.js",
"postinstall": "bower install && gulp build"
},
heroku 上的错误类似
npm ERR! Linux 3.13.0-49-generic
npm ERR! argv "/tmp/build_3c30c62b654a8b995e1a813913a68a7d/.heroku/node/bin/node" "/tmp/build_3c30c62b654a8b995e1a813913a68a7d/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build_3c30c62b654a8b995e1a813913a68a7d/.npmrc"
npm ERR! node v0.12.5
npm ERR! npm v2.11.2
npm ERR! code ELIFECYCLE
npm ERR! @ postinstall: `bower install && gulp build`
npm ERR! Exit status 1
希望有人能帮忙,谢谢
更新:
我发现问题与在我的 Sass 文件中使用外部导入有关
@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin");
删除这个导入并且它没有错误,这肯定是一个错误,但我不确定哪个包都是最新的
【问题讨论】:
-
如果您暂时删除
postinstall行,并在npm install之后手动运行bower install和gulp build...会发生什么?您是否将跟踪/提交凉亭安装的目录作为您的回购的一部分?