当前package.json文件:
{
"name": "ff-album",
"version": "1.0.0",
"description": "",
"main": "index.js",
"engines": {
"node": "0.12.7",
"npm": "2.11.3"
},
"scripts": {
"postinstall": "node ./node_modules/bower/bin/bower install"
},
"author": "",
"license": "CC",
"dependencies": {
"express": "4.13.1",
"http-server": "^0.8.4",
"bower": "^1.5.2"
},
"devDependencies": {
"bower": "^1.5.2"
}
}当前bower.json:
{
"name": "ff-album",
"version": "0.0.0",
"author": [
"Francesco Fibonacci"
],
"license": "CC",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"app/vendor",
"test",
"tests"
],
"resolutions": {
"bootstrap": "~3.3.1",
"angular": ">= 1.0.8",
"angular-bootstrap": "~0.12.0"
},
"dependencies": {
"angular": "~1.4.6",
"angular-bootstrap": "~0.13.4",
"angular-ui-router": "~0.2.15",
"bootstrap": "~3.3.5",
"jasny-bootstrap": "~3.1.3",
"lodash": "~3.10.1",
"moment": "~2.10.6",
"swagger-client-generator": "~0.2.13",
"swagger-js": "~2.1.5"
}
}在部署到herokuapp时,错误消息sh: 1: bower: not found不断出现(我尝试了大约10次)。我尝试过将postinstall更改为bower cache clean && bower install,就像https://github.com/auth0/auth0.js/issues/12那样,但没有效果。我也尝试过npm uninstall -g bower和重新安装保龄球,但仍然没有运气。
发布于 2017-07-16 21:55:52
搞清楚到底发生了什么!在将bower作为依赖项之一进行更改后,我没有使用add和commit package.json。
发布于 2016-04-03 19:00:27
您需要添加bower作为依赖项,不仅在devDependencies中,而且在:
"dependencies": {
"bower": "^1.5.2"
}https://stackoverflow.com/questions/33190674
复制相似问题