I am not able to install bower.
Steps carried out :
Installed node.js (current stable version v0.10.12)
Installed npm using apt-get (v1.1.4)
Tried installing bower using :
npm install bower
I get the possible node.js incompatible error.
The weird thing is that the error log indicates that the script went to the node directory & tried node -v to get an old version of node.js (v0.6.19) though when I do so manually I get v.0.10.12.
Error Log :
npm http GET https://registry.npmjs.org/bower
npm ERR! Error: No compatible version found: bower
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR! at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR! at /usr/share/npm/lib/cache.js:408:5
npm ERR! at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR! <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR! reportbug --attach /usr/share/node-v0.10.12/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.8.0-25-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "bower"
npm ERR! cwd /usr/share/node-v0.10.12
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: bower
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/share/node-v0.10.12/npm-debug.log
npm not ok
Need a way to install bower. Any ideas ?
I had the same issue on ubuntu 12.04 here is how I fixed it:
As GabLeRoux mentioned, Node version manager requires curl package to be installed and therefore you might need to install curl before:
sudo apt-get install curl -y
1) Clear NPM's cache:
sudo npm cache clean -f
2) Install a little helper called 'n' (node version manager)
sudo npm install -g n
3) Install latest stable NodeJS version
sudo n stable
4) Install Bower again
sudo npm install -g bower
Try this, because you must install it as superuser:
sudo npm install bower
You must type in your su password.
I recommend using the linux binary from nodejs.org. Available for both 32-bit and 64-bit versions and installs with NPM:
http://nodejs.org/download/
This should prevent any node/npm version conflicts.
For Cent OS users -
I first had to update NPM to get around this, and was getting errno 34 for bower on CentOS 7
sudo npm install -g npm
sudo npm install -g bower
If you get sudo npm command not found, you can edit /etc/sudoers to include npm bin path
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
Related
My Linux distribution is:
uname -a
Linux 16.04.2-Ubuntu
Also, my npm version was:
npm -v
3.5.2
I wanted to install version 3.10.10 of npm via this command:
sudo npm cache clean -f
sudo npm install npm#3.10.10
But I get these errors:
npm WARN enoent ENOENT: no such file or directory, open '/home/arvin/package.json'
npm WARN myname No description
npm WARN myname No repository field.
npm WARN myname No README data
npm WARN myname No license field.
And when using the same command for installed version 6.12.2 of Node.js:
sudo npm install nodejs#6.12.2
And I get these errors:
npm ERR! Linux 4.13.0-26-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "nodejs#6.12.2"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! No compatible version found: nodejs#6.12.2
npm ERR! Valid install targets:
npm ERR! 0.0.0
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /home/arvin/npm-debug.log
Finally, I decided to completely remove `npm' and Node.js via these commands:
sudo apt-get purge --auto-remove nodejs
sudo apt autoremove
sudo rm -R ~/.npm
sudo rm /usr/local/bin/npm, /usr/local/share/man/man1/node, /usr/local/lib/dtrace/node.d, ~/.node-gyp, /opt/local/bin/node, opt/local/include/node, /opt/local/lib/node_modules
sudo npm uninstall npm
So, how can I install npm v3.10.10 and Node.js v6.12.2 in Ubuntu 16.04 (Xenial Xerus)?
If you want to use npm to install npm, you need to use the -g flag to signal that the package should be installed globally. If you install without the -g flag, it will try to find a package.json file in the local directory.
sudo npm install -g npm#3.10.10
Btw, you cannot install Node.js with npm. To manage Node.js versions, you can use either nvm or n. I recommend using n.
I created an API that use hummus.js modules. Localy tested -> Works fine.
Now I uploaded my API and try to run npm install to install all dependencies. But I got this Error:
npm-Installation
Execution filemng has failed with exit code 1, stdout:
> hummus#1.0.81 install /var/www/vhosts/XXX/XXX/node_modules/hummus
> node-pre-gyp install --fallback-to-build
, stderr: npm WARN lifecycle npm is using /opt/plesk/node/7/bin/node but there is no node binary in the current PATH. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
/usr/bin/env: 'node': No such file or directory
npm WARN XXX#0.0.1 No description
npm WARN XXX#0.0.1 No repository field.
npm WARN XXX#0.0.1 No license field.
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/opt/plesk/node/7/bin/node" "/opt/plesk/node/7/bin/npm" "install"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! hummus#1.0.81 install: `node-pre-gyp install --fallback-to-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the hummus#1.0.81 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the hummus package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs hummus
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls hummus
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/vhosts/XXX/XXX/npm-debug.log
The Error come from the hummus-js package.
So I want to try install node-gyp ( npm install -g node-gyp ). But I don't know how? In Plesk I canno't install a single module. When I try it with ssh i got:
command NPM not found
I'm a Server-Admin-Noob so I'm happy for every Help!
Greetings
EDIT:
My Server = Ubuntu 16.04 LTS Server 64bit + Plesk Onyx
If I assumed correctly, it boils down to you not having Node installed on your other machine. SSH into the machine, then, for debian and ubuntu-based OS run
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
(assuming, again, that you wanted Node 8.x), then run
sudo apt-get install -y build-essential
and for CentOS and other enterprise Linux OS:
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum -y install nodejs
sudo yum install gcc-c++ make
Then try redoing what you did.
Installed node version v8 on windows 10. It says it comes delivered with npm 5....
But it's stuck on 3.5.3
λ npm i -g npm
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "npm" "i" "-g" "npm"
npm ERR! node v8.0.0
**npm ERR! npm v3.5.3**
**npm ERR! code MODULE_NOT_FOUND**
**npm ERR! Cannot find module 'internal/fs'**
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\user\npm-debug.log
What i've done:
Uninstall node and reinstall it
Install a different version of node (7.7.0) and see if it updated npm
used npm clean cache -f
And none of these things worked...
So any ideas?
I had the same problem and had to run
npm install npm#latest -g
from the command line. I was told node and npm versions will be different.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
Node is Updated to latest stable version v7.4.0
This is the error message I get when trying to install browser-sync:
sudo npm install -g browser-sync
'npm ERR! Linux 4.4.0-59-generic npm ERR! argv "/usr/local/bin/node"
"/usr/local/bin/npm" "install" "-g" "browser-sync" npm ERR! node
v7.4.0 npm ERR! npm v4.0.5 npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module 'internal/fs' npm ERR! npm ERR! If you
need help, you may report this error at: npm ERR!
https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! /home/pedro/npm-debug.log '
This problem occurs when you are installing a old module(as written in your package.json) but it is not available on git due to update in their version.
for solving this issue.
1.Need to install the project’s local dependencies (that’s where it’s looking for browser-sync). To do that,
2.cd into the project directory and run npm install.
3.You can also try npm i browser-sync --save
You're going to need to upgrade npm also (currently npm#next – npm -g install npm#next if you have it installed globally.
I have Solved the issue:
NPM Module was not supported by node v7:
So I downgraded to node v6.4.0 and it allowed me install browser-sync with no problems!
sudo npm cache clean -f
sudo npm install -g n
sudo n 6.9.5
I am trying to install Yeoman and I am following instructions on Yeoman official site but I have two problems. One is when I am trying to install Yeoman on Windows, problem after this step:
npm install --global yo bower grunt-cli
This is my terminal:
/usr/bin/env: ‘node’: No such file or directory
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "yo"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! yo#1.8.4 postinstall: yodoctor
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the yo#1.8.4 postinstall script 'yodoctor'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the yo package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! yodoctor
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs yo
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls yo
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/dev7/npm-debug.log
Follow the steps below to get up and running with yeoman in windows
system. First Install Ruby dependencies
Install Ruby for Windows from http://rubyinstaller.org/
Open Command prompt.
Check ruby version to confirm if ruby path is set. ruby -v. If this command fails, check if path of your ruby installation is added to environment variables or not. If path is not set (for ruby), add the path manually.
Installed bundler : gem install bundler
Install Compass : gem install compass
Install git tools
Install Github for windows from http://windows.github.com/
Install git from http://msysgit.github.io/. Before installing read the instruction for installing git in windows for use with bower. (optional step, only perform in bower not working)
Install node dependencies
Install node.js from http://nodejs.org/. Make sure you check the option Add path to environment variables while installing.
Open command prompt.
Install bower : npm install -g bower
Install grunt-cli : npm install -g grunt-cli
Install yeoman : npm install -g yo
Extra step for angular fanboys:
Install yeoman angular generator : npm install -g generator-angular
You can do all the above steps (expect installing node) in one command as well.
npm install -g bower grunt-cli yo generator-angular
Now you have everything you need to run yeoman and you also have installed angular project generator.
Source