Node 8.0 install, but npm stuck on old version - node.js

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

Related

Getting Error when trying to install browser-sync ubuntu

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

Install electron on ubuntu

When I try to install electron on Ubuntu 15.04 using
sudo npm install electron-prebuilt -g
This is what I get
/usr/local/bin/electron -> /usr/local/lib/node_modules/electron-prebuilt/cli.js
> electron-prebuilt#0.28.3 postinstall /usr/local/lib/node_modules/electron-prebuilt
> node install.js
Downloading electron-v0.28.3-linux-x64.zip
Error: tunneling socket could not be established, cause=139936635598656:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:795:
/usr/local/lib/node_modules/electron-prebuilt/install.js:15
throw err
^
Error: tunneling socket could not be established, cause=139936635598656:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:s23_clnt.c:795:
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! electron-prebuilt#0.28.3 postinstall: `node install.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the electron-prebuilt#0.28.3 postinstall script.
npm ERR! This is most likely a problem with the electron-prebuilt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls electron-prebuilt
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.19.0-18-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "electron-prebuilt"
npm ERR! cwd /usr/bin
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/bin/npm-debug.log
npm ERR! not ok code 0
I tried
Creating a system link for node with the command:
ln -s node nodejs in the /usr/bin/ folder
and
installing node-legacy package: sudo apt-get install node-legacy
as suggested here
with no luck.
Couldn't find anything more on other forums.So please help.
Thanks in advance.
Following steps worked for me:
(Assuming node and npm are already installed)
Updated the npm package to latest:-
sudo npm install npm#latest -g
Installed electron with following switches:
sudo npm install electron -g –-verbose --unsafe-perm=true --allow-root
Corrections/Suggestion from experienced people are always welcome. Hope it help to somebody.
use:
ELECTRON_MIRROR=https://npm.taobao.org/mirrors/electron/ npm install
Most likely you are behind a proxy.
You can disable it or make npm install work behind a proxy (see this question).
You typed it wrong
install nodejs-legacy
sudo apt-get install nodejs-legacy
to fix it and then continue installing electron
sudo npm install electron-prebuilt -g
sudo npm install electron -g
This worked for me
First install latest version of node and npm by
$ curl -sL https://deb.nodesource.com/setup_10.x | sudo bash -
$ sudo apt-get install -y nodejs
the latest npm version is now 6.9.0, check the npm version with npm --version
if the npm version is 6.4.1 just first update npm by
$ npm install -g npm
If you have problem with permissions caused by sudo then you can cd into .npm-global
$ cd /home/user_home_directory/.npm-global/
using chmod command to change permissions of all files and directories in this folder:
$ sudo chmod 777 * -R
After installation you must add this line to the end of .bashrc file:
export PATH="/home/user_home_directory/.npm-global/bin:$PATH"
After saving .bashrc just source it by
$ source .bashrc
After all done, you can install electron globally by
$ npm install -g electron
I reached here because my final app wasn't installing on ubuntu.
In case someone has the same problem go to the build location and run from terminal using :
sudo dpkg -i <name of your install/build file>
p.s. I didn't find this solution anywhere else which is why I'm posting it here
Using this helps me:
sudo npm install electron -g --unsafe-perm=true --allow-root
without --unsafe-perm=true --allow-root I got error message like this:
> electron#10.1.5 postinstall /usr/local/lib/node_modules/electron
> node install.js
Error: EACCES: permission denied, mkdtemp
'/usr/local/lib/node_modules/electron/electron-download-rSlUcU'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#10.1.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#10.1.5 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional
logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-11-13T04_43_27_809Z-debug.log

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

Trouble installing topojson on ubuntu

I've been trying to install topojson by following Mike Bostock's Let's Make a Map tutorial http://bost.ocks.org/mike/map/ and I believe I have managed to get the most recent version of Node.js and npm. $which ogr2ogr works as well. I'm quite new to programming and Ubuntu and would sincerely appreciate some thorough help as to why npm install topojson -g yields the following errors. When I try the same command with sudo it yields errors like: npm ERR! registry error parsing json and gyp ERR! stack Error: "pre" versions of node cannot be installed, use the --nodedir flag instead
Thanks!
npm ERR! Error: EACCES, open '/home/natecraft/.npm/7edf76d6-topojson.lock'
npm ERR! { [Error: EACCES, open '/home/natecraft/.npm/7edf76d6-topojson.lock']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/natecraft/.npm/7edf76d6-topojson.lock' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "/home/natecraft/.nvm/v0.10.15/bin/node" "/home/natecraft/.nvm/v0.10.15/bin/npm" "install" "topojson" "-g"
npm ERR! cwd /home/natecraft/Downloads/node-latest-install
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! path /home/natecraft/.npm/7edf76d6-topojson.lock
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/home/natecraft/.npm/7edf76d6-topojson.lock'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/natecraft/Downloads/node-latest-install/npm-debug.log
npm ERR! not ok code 0
First, please check your version of node.js -- use the stable version, not the devel version. Second, invoke the npm command as superuser.
$ sudo npm install -g topojson
So far, when I switch my node.js into stable version, TopoJSON installation is running well. Thank you for your attention.
I came across this error when installing topojson (Debian 3.2.0-4-amd64). My steps to get things working (also discussed here).
Install node v 0.11.10
git clone https://github.com/joyent/node.git
cd node
git checkout v0.11.10
./configure && make
sudo make install
Remove debian gyp and install via npm:
sudo apt-get remove gyp
npm install -g gyp
Explicitly install contextify, although that was the version already installed.
npm install contextify#0.1.7
then, installing topojson should work
sudo npm install -g topojson

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