Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MEAN stack, Win 7, git push heroku master results in sh: bower: not found error

Can some please advise why I'm getting this error when doing a git push heroku master on windows 7 for a basic mean stack app? I'm trying a basic mean stack app and did the following commands and finally "git push heroku master" command which resulted in the error - bower install
sh: bower: not found, npm ERR! weird error 127, npm ERR! not ok code 0, ! Failed to install --production dependencies with npm

cd mean-stack 
npm install
pm install -g bower
npm install -g yo grunt-cli [email protected]
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 [email protected] 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

       > [email protected] install /tmp/build_39luvwq9ok8kb/node_modules/connect-mongo/node_modules/mongodb/node_modules/bson
       > (node-gyp rebuild 2> builderror.log) || (exit 0)


       > [email protected] install /tmp/build_39luvwq9ok8kb/node_modules/mongoose/node_modules/mongodb/node_modules/kerberos
       > (node-gyp rebuild 2> builderror.log) || (exit 0)


       > [email protected] 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'

       > [email protected] 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 [email protected]:afternoon-spire-6716.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]: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"
}
like image 766
user2712585 Avatar asked Aug 24 '13 22:08

user2712585


1 Answers

You have bower listed in you devDependencies but not in your dependencies. devDependencies are only installed in the development environment.

-----> Installing dependencies with npm

So when Heroku runs npm install its running the production environment and is not installing the devDeps, including bower. Thats your issue!

like image 169
Jim Hall Avatar answered Nov 15 '22 17:11

Jim Hall