-
Notifications
You must be signed in to change notification settings - Fork 3k
npm update -g
fails and causes /usr/local/lib/node_modules
to be deleted
#8165
Comments
If I run |
@CaptSaltyJack |
Thanks for reporting this!
Fortunately, quite a lot of this deferred maintenance has been finished recently. I'm sorry that it still bit you -- or possibly, this is even a new error that bit you. For future reference, the preferred way to do an update of
It's important to have a recent Thanks! |
This issue exists in the 2.9.0 in the case of |
Thanks for following up; it sounds like we can do more to avoid the problem on updates. Before 2.7 'npm update' was totally broken; it would try to update npm's own dependencies while npm was running. Now it is only sometimes broken... |
Yeah, it happens to me when I forgot to |
@silverwind if you |
@smikes unfortunately not, but my permissions are a real messy:
The actual error I'm getting on
which is
As far as I can tell the only issue is the missing symlink after a failed update, running |
@captSaltyJack can you check whether just the link is missing or the whole node_modules/lib directory? On Sat, May 2, 2015 at 4:39 PM, silverwind notifications@github.com
|
Hey guys, sorry I can't be of much help. My install is working (and I have to keep it that way so I can get some stuff done). But no, the entire |
Probably a different issue than mine. As for mine, a fix would probably to check write permission in both the global module folder as well as the symlink location before unlinking anything. |
This is the first time I've heard of |
npm update -g
fails and causes /usr/local/lib/node_modules
to be deleted
npm is installed along with io.js through the official io.js 2.0 installer. The content of
Note that I have no idea where that macports user comes from, as I've long switched to brew, but I assume it doesn't matter in this case. I'm unable to delete any file in this folder without elevating.
Based on these permissions and owner, I'd assume only root can delete this symlink, but I've manually tested it and was still able to. Maybe I'm missing something here. After installing, I run
And the symlink is gone. Same happens when I try to update any globally installed module. Hope that helps. |
@silverwind That's the expected failure mode (which, by the by, is addressed in
The important privileges are those on |
Indeed,
Also, thanks for the unix permission lesson 😉 |
By the way, my issue was only about the symlink deletion, not the whole directory. Sorry for hijacking this issue with that. |
Me too! I was incorrectly thinking about permissions on the link (above). It sounds like @CaptSaltyJack has been able to work around this - can this now be closed, or should we keep it open? |
If I understand @othiym23 correctly, the symlink thing is fixed already in |
I had the same issue and resolved it with this: |
@jozhi leifeng 666 |
Do not use |
I might have a similar issue, I tried to install the
dsenableroot:: ***Successfully enabled root user.` Any help appreciated. |
Run these commands in a terminal window (note - DON'T replace the $USER part... thats a Linux command to get your user!):
|
Although that works, I am not a fan of changing system directories own by root to be wrtiable by the user. to repeat:
That works with the ubuntu default packages installed by: |
I don't remember where I got this command but it worked for me so I saved it in google drive.
|
We're closing this issue as it has gone thirty days without activity. In our experience if an issue has gone thirty days without any activity then it's unlikely to be addressed. In the case of bug reports, often the underlying issue will be addressed but finding related issues is quite difficult and often incomplete. If this was a bug report and it is still relevant then we encourage you to open it again as a new issue. If this was a feature request then you should feel free to open it again, or even better open a PR. For more information about our new issue aging policies and why we've instituted them please see our blog post. |
Had this issue 5 min ago. still trying to figure out how to fix this. |
@VGerris' solution worked for me: #8165 (comment) Thanks! 😉 |
super user do helped |
I tried creating a separate drive as well as reinstalling node and npm, but I've had no luck. |
This comment has been minimized.
This comment has been minimized.
Or read back and see how to do it in a more controlled way. |
you can try: |
sudo chown -R |
Just want to point out again, for posterity, that this solution is recommended on the nodejs page and doesn't require resetting any permissions: #8165 (comment) |
I have no idea what's going on here, but it's way messed up.
I install node/npm via the official website. Of course it installs as admin, which is problematic when you try to run
sudo npm update -g
. I've always gotten permission errors, so I think the general consensus is to dosudo chown -R myusername:staff /usr/local/lib/node_modules
.After doing that, I run
npm update -g
. I get the following:And then boom, the entire
/usr/local/lib/node_modules
folder vanishes. So I have to removesemver.7
man page, reinstall the Node.js package again, and start over.Is there a clean way to uninstall Node.js for Mac?
The text was updated successfully, but these errors were encountered: