And this works for any other global npm package. Great thing is that npm can update itself. # navigate to nvm's node lib folder # (replace v8.4.0 with your version) cd ~/.nvm/versions/node/v8.4.0/lib/ # update npm right there npm install npm # reopen your terminal Once I found it, it was super easy to update npm in that specific folder. So I tried to find a path where global packages are installed when using nvm. I can't remember the exact error, but it was probably something with my PATH configuration. However, when I was using a "system" node version, installed from Node.js website, it did. You can see the exact version installed for your project using the npm list command: npm list n-app1.0.0 lodash3.5.0 Since npm packages frequently release a new version, at some time in the future you may need to update your package. Recently I got npm update notification, that looks something like this:įor some reason, when I had node installed through nvm, npm i -g npm didn't work. The npm install command always install the latest version of the package you defined. There are 5399 other projects in the npm registry using npm. Start using npm in your project by running npm i npm. Conclusion Step 1: Check the current NPM version You should know the current version of NPM installed on your system before issuing any command to change it. Node Version Manager is easy way to install, manage and work with multiple node versions. Latest version: 9.6.3, last published: 6 hours ago. Step 1: Check the current NPM version Step 2: Install a new version of NPM Step 3: Verify the new NPM version Step 4: Switch back to the previous NPM version NVM Usage to switch Node version. If you are JavaScript developer and not using nvm you might want to look at it. Going forward, when you want to upgrade your version of Node.js, download the new installer and it will replace the current version.
0 Comments
Leave a Reply. |