bash: bower: command not found with NVM - bower

I use nvm and I have McAfee with Windows 10 (so my C:\Users\User\AppData\Roaming\nvm\v8.9.2\node_modules\npm\node_modules is empty at the beginning, so I copy/paste manualy all node_modules (with bower and bower-config) inside.
I use this:
npm install bower -g
And
npm bower --version
5.5.1
but
bower --version
bash: bower: command not found
EDIT:
npm bower --version 5.5.1 is not bower verion but npm version!!

On windows 10 + NVM
npm config set prefix /c/Users/xxxxxxx/AppData/Roaming/nvm/v8.9.2
npm install -g bower
bower --version
1.8.8

Related

Install npm and gulp in docker4drupal

I am working on an existing project that was built by Droopler distribution and docker4drupal. As per Droopler distribution documentation, it requires npm and gulp to compiled sass easily and docker4drupal don't have it by default.
I tried to install in the container by sudo apt-get install npm and it says:
sudo: apt-get: command not found
Is there any way to install npm and gulp in docker4drupal for my existing project?
I am able to install npm & gulp, access php container and install those.
access php container docker-compose exec php bash
install npm sudo apk update && sudo apk add npm
install gulp globally sudo npm install -g gulp
This is how I do it, maybe there is a better way.
Reference: Install npm and gulp

Install npm bower offiline

Is there any way to install Bower Offilne?
I'm trying to install bower but the same is probably being blocked by some proxy, I would need to install offline
I am using the command:
npm install -g bower on cmd and git cmd.
node.js and npm is instaled.
You can download the Bower zip file and install it as described here.

No executable found matching command "bower"

I run this command on AppVeyor:
dotnet publish .\src\ReviewerServices.web -c Release
ReviewerServices.web is the folder containing my .NET MVC app and I want to create all the files to publish on IIS
Unfortunately, what I get is:
locally I get the same error. Do I need to install bower? npm install -g bower?
Ok, I had to install bower and gulp
npm install -g bower
npm install -g gulp
I have solved the problem.
need to install bower and gulp as a global packages.
npm install -g bower
npm install -g gulp

Cannot install a generator with yo

I am discovering Yeoman and I try to install a simple generator shown in yeoman's "Getting Started" section..
I installed npm then yo and bower like explained in the documentation :
npm install -g yo bower
When I try to install generator-webapp and generator-spring (sudo npm install -g generator-webapp), I get this output in both cases:
[...]
npm http 304 https://registry.npmjs.org/amdefine
npm http 304 https://registry.npmjs.org/es6-iterator
npm http 304 https://registry.npmjs.org/es6-symbol
npm ERR! peerinvalid The package yo does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer generator-mocha#0.1.6 wants yo#>=1.0.0
npm ERR! peerinvalid Peer generator-spring#0.1.2 wants yo#>=1.0.0-rc.1
npm ERR! peerinvalid Peer generator-webapp#0.5.1 wants yo#>=1.2.0
npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "generator-webapp"
npm ERR! cwd /home/adenoyelle
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18
npm ERR! code EPEERINVALID
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/adenoyelle/npm-debug.log
npm ERR! not ok code 0
Hence, I looked at yo version's :
~ [ sudo npm update -g yo
npm http GET https://registry.npmjs.org/yo
npm http 304 https://registry.npmjs.org/yo
~ [ yo -version
1.1.2
So, I have a few questions :
Why Yo's version is stuck to 1.1.2 (It seems that a version 1.3.3 exists)
Why does Yo also try to get generator-webapp when I ask generator-spring? generator-spring only requires Yo 1..0.0-rc.1 so it should work.
It's happened to me as well. I have no idea the reason why it is having some issues, even trying to install any dependency by separated.
Anyway, what I have done to solve this after spending some hours installing, reistalling, cleaning caches, googling and so on and so forth was basically updating nodejs.
I am on Linux Mint, then Ubuntu and Debian should be the same or similar.
To sum up,
Install nvm before
nvm ls-remote
nvm install 0.12.0
nvm use 0.12.0
node -v
npm install -g generator-webapp
npm install -g yo bower grunt-cli gulp
I would recommend to use nvm for updating node, you can follow this guide or tutorial
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server#how-to-install-using-nvm
After that, I was able to install yo and its dependencies without any problem.
By the way I chose version node v0.12.0
Hope this help

Installing ios-sim 1.9.0 fails at preinstall during rake build

My ios-sim broke recently after installing system updates, and I'm trying to re-install it. Currently, it's not installed in my directory. When running sudo npm install -g ios-sim, I receive this error.
$ sudo npm install -g ios-sim
npm http GET https://registry.npmjs.org/ios-sim
npm http 304 https://registry.npmjs.org/ios-sim
> ios-sim#1.9.0 preinstall /usr/local/lib/node_modules/ios-sim
> rake build
events.js:72
throw er; // Unhandled 'error' event
^
Error: Cannot find module './ios-sim' from '/usr/local/lib/node_modules/ios-sim'
at /usr/local/lib/node_modules/rake/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:36:25
at load (/usr/local/lib/node_modules/rake/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:54:43)
at /usr/local/lib/node_modules/rake/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:60:22
at /usr/local/lib/node_modules/rake/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:16:47
at Object.oncomplete (fs.js:107:15)
npm ERR! ios-sim#1.9.0 preinstall: `rake build`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the ios-sim#1.9.0 preinstall script.
npm ERR! This is most likely a problem with the ios-sim package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! rake build
npm ERR! You can get their info via:
npm ERR! npm owner ls ios-sim
npm ERR! There is likely additional logging output above.
I've updated Node.JS to 1.4.3.
Does anyone know why this is happening and how I can fix it?
on my system install using node.js(v0.10.8)
$ sudo npm install -g ios-sim
also failed..
however
$ git clone git://github.com/phonegap/ios-sim.git
$ cd ios-sim
$ sudo rake install prefix=/usr/local
worked fine..
You just need to set your developer active directory:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Then you can install ios-sim as you would normally do: npm install ios-sim -g.
Check your version of Xcode, report it. Do you have Xcode Command-line tools installed also?
If you are on Mavericks:
$ xcode-select --install

Resources