Reputation: 11
This Error keeps happening for me when i'm trying to update NPM for some work. I have used this always it before in Windows Command Prompt but not in Linux Bash
npm i -g npm
Specify configs in the ini-formatted file:
/root/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] /usr/lib/node_modules/npm
root@DESKTOP-SJPLLRG:~# npm -v
5.6.0
root@DESKTOP-SJPLLRG:~# npm i -g npm
npm ERR! path /usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/stream-each
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall rename
npm ERR! Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/stream-each' -> '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/.stream-each.DELETE'
npm ERR! { Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/stream-each' -> '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/.stream-each.DELETE'
npm ERR! cause:
npm ERR! { Error: EACCES: permission denied, rename '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/stream-each' -> '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/.stream-each.DELETE'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/stream-each',
npm ERR! dest: '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/.stream-each.DELETE' },
npm ERR! stack: 'Error: EACCES: permission denied, rename \'/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/stream-each\' -> \'/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/.stream-each.DELETE\'',
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'rename',
npm ERR! path: '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/stream-each',
npm ERR! dest: '/usr/lib/node_modules/npm/node_modules/npm-profile/node_modules/make-fetch-happen/node_modules/mississippi/node_modules/.stream-each.DELETE',
npm ERR! parent: 'mississippi' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-06-21T13_00_43_617Z-debug.log
Some details on my environment:
1) I used Windows Subsystem for Linux Platform for installation of Node.js
2) I tried it while I was in root only.
3) I tried to update the NPM package using some command shown in this NPM update Link
But Still not able to perform the update. It shows the following error
root@DESKTOP-SJPLLRG:~# npm install npm -g
-bash: /usr/bin/npm: No such file or directory
root@DESKTOP-SJPLLRG:~#
I'm stuck to even proceed further. Is there something that can be done to clear up this error and update NPM ?
Edit No 2:
I have tried to reinstall Node.js and NpM but below error pops up
ash@DESKTOP-SJPLLRG:~$ sudo apt-get install npm
[sudo] password for ash:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
npm : Depends: nodejs but it is not going to be installed
Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed
Depends: node-ansi-color-table but it is not going to be installed
Depends: node-archy but it is not going to be installed
Depends: node-block-stream but it is not going to be installed
Depends: node-fstream (>= 0.1.22) but it is not going to be installed
Depends: node-fstream-ignore but it is not going to be installed
Depends: node-github-url-from-git but it is not going to be installed
Depends: node-glob (>= 3.1.21) but it is not going to be installed
Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
Depends: node-inherits but it is not going to be installed
Depends: node-ini (>= 1.1.0) but it is not going to be installed
Depends: node-lockfile but it is not going to be installed
Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed
Depends: node-minimatch (>= 0.2.11) but it is not going to be installed
Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed
Depends: node-gyp (>= 0.10.9) but it is not going to be installed
Depends: node-nopt (>= 3.0.1) but it is not going to be installed
Depends: node-npmlog but it is not going to be installed
Depends: node-once but it is not going to be installed
Depends: node-osenv but it is not going to be installed
Depends: node-read but it is not going to be installed
Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed
Depends: node-request (>= 2.25.0) but it is not going to be installed
Depends: node-retry but it is not going to be installed
Depends: node-rimraf (>= 2.2.2) but it is not going to be installed
Depends: node-semver (>= 2.1.0) but it is not going to be installed
Depends: node-sha but it is not going to be installed
Depends: node-slide but it is not going to be installed
Depends: node-tar (>= 0.1.18) but it is not going to be installed
Depends: node-underscore but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Can you guys provide me any technique to reinstall both Node.js and NPM?
Upvotes: 1
Views: 4588
Reputation: 162
You need to clean cache of npm
sudo npm cache clean -f
And then, Update command
npm install -g npm
then, to remove vulnerable
npm audit fix --force
Upvotes: 2
Reputation: 2703
The command output is:
-bash: /usr/bin/npm: No such file or directory
It seems that npm does not exist in your system for some reason. Try reinstalling NodeJS.
Upvotes: 0