AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Windows nvm10/12/2023 Just update the version that nvm installed, which lives in ~/.nvm/versions/node//lib/node_modules/npm. Over three years after this question was first asked, it seems like the answer is much simpler now. Nvm install -latest-npm: After installing, attempt to upgrade to the latest working npm on the given node versionīelow are previous revisions of the correct answer to this question. Nvm install-latest-npm: Attempt to upgrade to the latest working npm on the current node version It's nvm install-latest-npm or nvm install -latest-npm. It will then typically be found in the local directory in /node_modulesĮDIT: several years since this question was first answered, as noted in a newer answer, there is now a command for this: Npm install pm2 - pm2 will be installed locally. It will then typically be found in /usr/local/lib/node_modules (Use npm root -g to check where.) Npm install -g pm2 - pm2 will be installed globally. When installing use -g option to install globally You can run npm list to see the installed non-global libraries for your current location. Non-global libraries are installed the node_modules sub folder in the folder you are currently in. Windows 7, 8 and 10 - %USERPROFILE%\AppData\Roaming\npm\node_modules Non-global libraries Windows XP - %USERPROFILE%\AppData\npm\node_modules If you set the NODE_PATH environment variable to this path, the modules can be found by node. On Unix systems they are normally placed in /usr/local/lib/node or /usr/local/lib/node_modules when installed globally. If you want to display only main packages not its sub-packages which installs along with it - you can use - npm list -depth=0 which will show all packages and for getting only globally installed packages, just add -g i.e. Use npm list -g | head -1 for truncated output showing just the path. You can run npm list -g to see which global libraries are installed and where they're located.
0 Comments
Read More
Leave a Reply. |