AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Homebrew install node 149/10/2023 If you install node with Homebrew and then try to do npm update npm -g, you may see an error like this: $ npm update npm -g If you're a Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. Now you can re-install any global npm packages you need without any problems. Run the following commands to remove all existing global npm modules, uninstall node & npm, re-install node with the correct defaults, configure the location for global npm modules to be installed, and then install npm as its own pacakge.Įxport PATH= " $HOME/.npm-packages/bin: $PATH " After you're finished you'll need to re-install them. These instructions will have you remove all of those packages. Once you're finished, you also won't need to use sudo to install npm modules globally.īefore you start, make a note of any globally installed npm packages. This solution fixes the error caused by trying to run npm update npm -g. An explanation is also included at the end of this document. To fix it quickly, use the solution below. Installing node through Homebrew can cause problems with npm for globally installed packages. Fixing npm On Mac OS X for Homebrew Users I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work. I've kept it here for historical purposes, but it should no longer be used. It was only ever intended to fix a specific error message which has since been fixed. This entire guide is based on an old version of Homebrew/Node and no longer applies.
0 Comments
Read More
Leave a Reply. |