Hi Im trying to deploy a npm/bower/gulp project to heroku, but I'm getting a very generic error which I get running locally as well
嗨我试图将一个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
The full npm-debug.log can be found at https://gist.github.com/sjmcpherso/64be7626f37b3f296bb2 as well as my package.json
完整的npm-debug.log可以在https://gist.github.com/sjmcpherso/64be7626f37b3f296bb2以及我的package.json找到。
In my package.json I have a postinstall task which runs 'bower install' and then 'gulp build', if I run these individually they all work fine
在我的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"
},
On heroku the error is similar
在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
Hope someone can help, thanx
希望有人可以提供帮助,而不是
UPDATE:
I found the issue is related to use of an external import in my Sass file
我发现该问题与我在Sass文件中使用外部导入有关
@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic&subset=latin");
Remove this import and its error free, this is certainly a bug but I'm not certain which package as all are upto date
删除此导入及其错误,这肯定是一个错误,但我不确定哪个包是最新的
1 个解决方案
#1
2
Setting the processImport flag to false in gulp-minify-css allowed me to include the font import and since the .scss imports are handled before this it won't affect them
在gulp-minify-css中将processImport标志设置为false允许我包含字体导入,因为在此之前处理.scss导入它不会影响它们
.minifyCss({processImport: false}))
#1
2
Setting the processImport flag to false in gulp-minify-css allowed me to include the font import and since the .scss imports are handled before this it won't affect them
在gulp-minify-css中将processImport标志设置为false允许我包含字体导入,因为在此之前处理.scss导入它不会影响它们
.minifyCss({processImport: false}))