When working with node there will be times when you need to change version or run the latest. To install a package and save it in your project's package. The easiest way to install Node.js on Mac OS X is to use Brew. To install a package: npm install # Install locally Nvm alias default node # set the installed stable version as the default Node Nvm ls-remote # list all the Node versions you can install Nvm use node # use stable as current version Nvm install node # install most recent Node stable version Then download Node and select your version by running: source ~/.bashrc # source your bashrc/zshrc to add nvm to PATH command -v nvm # check the nvm use message brew install node sudo chmod 776 /usr/local/lib brew link -overwrite node sudo chmod 755 /usr/local/lib When I ran npm -v I got the same error: internal/modules/cjs/loader.js:983 throw err To solve it I ran brew reinstall node and everything is running as expected now. Type which brew to find if it is properly installed. Installation Using Homebrew brew install nodeÄownload and install nvm by running: curl -o- | bash To install Node on MAC using Homebrew, you need to install Homebrew first. Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |