Reputation: 4204
When trying to upgrade my Node version using either
nvm install v10.15.0 --reinstall-packages-from=8.9.4
or
nvm install lts/* --reinstall-packages-from=node
I receive the following error:
If --reinstall-packages-from is provided, it must point to an installed version of node.
I also tried changing =node
to a path that points to where I have installed node, e.g., /usr/local/bin/node
.
I have also tried not using the NVM method, and using the instructions provided here, but I receive the following:
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/n-3eb27508/.github' /usr/local/lib/node_modules/.staging
WARN tar EISDIR: illegal operation on a directory, open '/usr/local/lib/node_modules/.staging/n-3eb27508/bin'
npm ERR! path /usr/local/lib/node_modules/n/bin/n
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/local/lib/node_modules/n/bin/n'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
Any ideas?
Upvotes: 1
Views: 876
Reputation: 4311
In my case, it was because I had installed Node directly from the installer at the Node.js website, and the first time I tried to update it with npm
, I got a permissions error, and was pointed to a solution to use nvm
. So in my case, I think the error was because nvm was unaware of my previous installation of Node. Ended up just completely deleting node, npm and related files from my Mac (as per How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)) and just doing nvm install node
Upvotes: 2
Reputation: 4204
Resolved this by simply downloading a new version of the OSX installer from the Node JS website and overwriting the previous version!
Upvotes: 1