Getting Error when trying to install browser-sync ubuntu - node.js

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

Related

Node 8.0 install, but npm stuck on old version

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

unable to run npm typings install

I want to run an existing MEAN Stack Project. The steps I am following are first I am running npm install and then npm run typings -- install because I can't see any typings folder. But I am getting these errors.
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "typings" "--" "install"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! missing script: typings
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/sami/projects/myappadmin/npm-debug.log
I am not sure how to get rid of this I spent a lot of time on google and tried different solutions but nothing worked for me.
My node version is v6.9.5. nodejs version is v4.4.7. MongoDB shell version: 3.0.9. npm 3.10.10. nvm 0.31.1 ubuntu : 15.10.
This issue exists probably because you don't have "typings" script defined in your package.json. If you want to install typings, use
npm install typings -g
why you are using typings use #types instead , read this article:
#Types

Failing to install the Grunt command line interface

I am currently having trouble installing the grunt command line interface, i get a whole lot of errors on the log when I try and install it using instructions off a tutorial website. I just added node.js from a package I downloaded off their website. Any help would be appreciated?
I used the following command as detailed on the roots WordPress instructions page
npm install -g grunt-cli
and this error message was returned
npm ERR! Error: Attempt to unlock grunt-cli, which hasn't been locked
npm ERR! at unlock (/usr/local/lib/node_modules/npm/lib/utils/locker.js:44:11)
npm ERR! at cb (/usr/local/lib/node_modules/npm/lib/cache/add-local.js:30:5)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache/add-local.js:47:20
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/locker.js:30:7
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38
npm ERR! at OpenReq.Req.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:144:5)
npm ERR! at OpenReq.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:64:22)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "grunt-cli"
npm ERR! cwd /Users/jonbeech
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/jonbeech/npm-debug.log
npm ERR! not ok code 0
➜ ~
Run sudo npm install -g grunt-cli you need sudo privileges when installing something globally, or remove the -g switch.
Try to avoid needing sudo with npm, there are likely going to be other permissions errors. Here is what I did after installing npm with sudo:
Uninstall NPM: sudo npm uninstall npm -g
Install NVM so that I can install npm without needing sudo (similar to RVM), see: https://github.com/creationix/nvm#installation
Install latest npm: nvm install stable
Clear caches npm cache clear
and then everything worked

Unable to install node modules

I've installed node on my debian squeeze dedicated server, but i can't install new mode module
ex : npm install async
Results :
root#....# npm install async
npm http GET https://registry.npmjs.org/async
npm ERR! Error: failed to fetch from registry: async
npm ERR! at /usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:32:9)
npm ERR! at Request._callback (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/request.js:137:18)
npm ERR! at Request.callback (/usr/local/lib/node_modules/npm/node_modules/request/main.js:109:22)
npm ERR! at Request.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:198:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/request/main.js:356:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.onIncoming (http.js:1238:11)
npm ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
npm ERR! You may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR!
npm ERR! System Linux 3.2.13-xxxx-std-ipv6-64
npm ERR! command "node" "/usr/local/bin/npm" "install" "async"
npm ERR! cwd /root
npm ERR! node -v v0.6.8
npm ERR! npm -v 1.1.0-2
npm ERR! message failed to fetch from registry: async
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm not ok
UPDATE (1/11/2015):
I now use NVM to manage my node/npm installation on both Linux and Unix. It's super simple; just follow these steps.
Install NVM.
$ curl https://raw.githubusercontent.com/creationix/nvm/v0.22.1/install.sh | bash
Use NVM to install the latest stable version of node and NPM.
$ nvm install stable
Tell NVM to use the stable version as the default version in future bash instances.
$ nvm alias default stable
Now you're all set with node & NPM. NVM even gets rid of the permissions issues with NPM global modules on Ubuntu, which normally requires you to chown or sudo and causes all sorts of frustration. You can use NVM to install different versions of node/NPM side by side as well. You can switch between installed versions with nvm use {version}, as long as you've done nvm install {version} already.
I think you may be running a really old version of node & npm. I see that node is v0.6.8 and npm is 1.1.0-2 when the current versions are 0.10.26 & 1.4.6 respectively. I'd try upgrading your node and npm installs and then try installing modules again and see if that fixes it for you.
Head over to http://nodejs.org and click the big green button in order to get the node installer. It will install both node & npm together.
Note: It's sometimes better not to install node/npm from a package manager unless you're confident the version listed in the package manager is the latest version. It's important to keep npm up to date. Npm even updates itself along with all your global node modules when you run npm update -g.

Not able to install bower using npm on Ubuntu 13.04

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

Resources