gpt4 book ai didi

git - 平均堆栈,Win 7,git push heroku master 结果在 sh : bower: not found error

转载 作者:太空狗 更新时间:2023-10-29 12:52:59 26 4
gpt4 key购买 nike

有人可以告诉我为什么在 Windows 7 上为基本平均堆栈应用程序执行 git push heroku master 时出现此错误吗?我正在尝试一个基本的均值堆栈应用程序并执行了以下命令,最后执行了导致错误的“git push heroku master”命令 - bower install
sh: bower: 未找到,npm ERR!奇怪的错误 127,npm ERR!不好代码 0, !无法使用 npm 安装 --production 依赖项

cd mean-stack 
npm install
pm install -g bower
npm install -g yo grunt-cli bower@0.9.2
bower install
git init
git add .
git status
git add -f public/lib
git commit -m "init"
heroku create
git push heroku master
 C:\ss\D1\google\04\mean\mean-stack>git push heroku master
Enter passphrase for key '/c/ss/D1/google/04/eclipse/eclipse/.ssh/id_rsa':
Counting objects: 466, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (448/448), done.
Writing objects: 100% (466/466), 8.61 MiB | 522 KiB/s, done.
Total 466 (delta 55), reused 0 (delta 0)

-----> Node.js app detected
-----> Resolving engine versions
Using Node.js version: 0.10.15
Using npm version: 1.2.30
-----> Fetching Node.js binaries
-----> Vendoring node into slug
-----> Installing dependencies with npm
npm WARN package.json mean@1.0.0 No repository field.
npm http GET https://registry.npmjs.org/express
npm http GET https://registry.npmjs.org/connect-flash
npm http GET https://registry.npmjs.org/mongoose
npm http GET https://registry.npmjs.org/passport
npm http GET https://registry.npmjs.org/passport-local
....
....
npm http GET https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/sigmund
npm http 200 https://registry.npmjs.org/sigmund
npm http GET https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http 200 https://registry.npmjs.org/lru-cache
npm http GET https://registry.npmjs.org/lru-cache/-/lru-cache-2.3.1.tgz
npm http 200 https://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http 200 https://registry.npmjs.org/lru-cache/-/lru-cache-2.3.1.tgz

> bson@0.1.8 install /tmp/build_39luvwq9ok8kb/node_modules/connect-mongo/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)


> kerberos@0.0.3 install /tmp/build_39luvwq9ok8kb/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
> (node-gyp rebuild 2> builderror.log) || (exit 0)


> bson@0.2.2 install /tmp/build_39luvwq9ok8kb/node_modules/mongoose/node_modules/mongodb/node_modules/bson
> (node-gyp rebuild 2> builderror.log) || (exit 0)

make: Entering directory `/tmp/build_39luvwq9ok8kb/node_modules/connect-mongo/node_modules/mongodb/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
make: Entering directory `/tmp/build_39luvwq9ok8kb/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'
CXX(target) Release/obj.target/bson/ext/bson.o
make: Entering directory `/tmp/build_39luvwq9ok8kb/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
SOLINK_MODULE(target) Release/obj.target/kerberos.node
SOLINK_MODULE(target) Release/obj.target/kerberos.node: Finished
COPY Release/kerberos.node
make: Leaving directory `/tmp/build_39luvwq9ok8kb/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos/build'
SOLINK_MODULE(target) Release/obj.target/bson.node
SOLINK_MODULE(target) Release/obj.target/bson.node: Finished
COPY Release/bson.node
make: Leaving directory `/tmp/build_39luvwq9ok8kb/node_modules/connect-mongo/node_modules/mongodb/node_modules/bson/build'
SOLINK_MODULE(target) Release/obj.target/bson.node
SOLINK_MODULE(target) Release/obj.target/bson.node: Finished
COPY Release/bson.node
make: Leaving directory `/tmp/build_39luvwq9ok8kb/node_modules/mongoose/node_modules/mongodb/node_modules/bson/build'

> mean@1.0.0 postinstall /tmp/build_39luvwq9ok8kb
> bower install

sh: bower: not found
npm ERR! weird error 127
npm ERR! not ok code 0
! Failed to install --production dependencies with npm

! Push rejected, failed to compile Node.js app

To git@heroku.com:afternoon-spire-6716.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:afternoon-spire-6716.git'

===========package.json

{
"name": "mean",
"description": "Mongo",
"version": "1.0.0",
"private": false,
"author": "MEAN - A Modern Stack: MongoDB, ExpressJS, AngularJS, NodeJS. (BONUS: Passport User Support).",
"engines": {
"node": "0.10.x",
"npm": "1.2.x"
},
"scripts": {
"start": "NODE_ENV=development ./node_modules/.bin/nodemon server.js",
"test": "NODE_ENV=test ./node_modules/.bin/mocha --reporter spec test/test-*.js",
"postinstall": "./node_modules/bower/bin/bower install"
},
"dependencies": {
"express": "latest",
"jade": "latest",
"mongoose": "latest",
"connect-mongo": "latest",
"connect-flash": "latest",
"passport": "latest",
"passport-local": "latest",
"passport-facebook": "latest",
"passport-twitter": "latest",
"passport-github": "latest",
"passport-google-oauth": "latest",
"underscore": "latest",
"async": "latest",
"view-helpers": "latest",
"mean-logger": "latest"
},
"devDependencies": {
"supertest": "latest",
"should": "latest",
"mocha": "latest",
"bower": "latest",
"grunt": "~0.4.1",
"grunt-contrib-compass": "~0.3.0",
"grunt-contrib-watch": "~0.4.4",
"grunt-contrib-jshint": "~0.6.0",
"grunt-nodemon": "0.0.8",
"grunt-concurrent": "~0.3.0"
}
}

=========bower.json

{
"name": "angularJS-IL",
"version": "1.0.0",
"dependencies": {
"bootstrap": "2.3.2",
"angular": "~1.0.6",
"angular-resource": "~1.0.6",
"angular-cookies": "~1.0.6",
"angular-bootstrap": "~0.4.0",
"json3": "~3.2.4",
"jquery": "~1.9.1"
},
"devDependencies": {
"angular-mocks": "~1.0.5",
"angular-scenario": "~1.0.5"
}
}

==============.bowerrc

{
"directory": "public/lib",
"json": "bower.json"
}

最佳答案

您在 devDependencies 中列出了 Bower,但在您的 dependencies 中没有。 devDependencies 仅安装在开发环境中。

-----> Installing dependencies with npm

因此,当 Heroku 运行 npm install 时,它运行的是生产环境,而不是安装 devDeps,包括 bower。那是你的问题!

关于git - 平均堆栈,Win 7,git push heroku master 结果在 sh : bower: not found error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18423965/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com