sh: 1: bower: 部署到 herokuapp 时未发现错误
sh: 1: bower: not found error while deploying to herokuapp
当前 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 次)。我尝试按照 https://github.com/auth0/auth0.js/issues/12 将 postinstall
更改为 bower cache clean && bower install
,但无济于事。我也试过 npm uninstall -g bower
并重新安装了 bower,但还是不行。
您需要将 bower 添加为依赖项,不仅在 devDependencies 中,而且在:
"dependencies": {
"bower": "^1.5.2"
}
弄清楚发生了什么!在将 bower 作为依赖项之一进行更改后,我没有 add
和 commit
package.json。
当前 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 次)。我尝试按照 https://github.com/auth0/auth0.js/issues/12 将 postinstall
更改为 bower cache clean && bower install
,但无济于事。我也试过 npm uninstall -g bower
并重新安装了 bower,但还是不行。
您需要将 bower 添加为依赖项,不仅在 devDependencies 中,而且在:
"dependencies": {
"bower": "^1.5.2"
}
弄清楚发生了什么!在将 bower 作为依赖项之一进行更改后,我没有 add
和 commit
package.json。