Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.97 KB

ToolNpm.md

File metadata and controls

60 lines (42 loc) · 1.97 KB

NPM (Node Package Manager)

Installing npm

Ubuntu

Windows

  • Installing from the installer

  • Installing with the CLI

    iex (new-object net.webclient).downstring(‘https://get.scoop.sh’)
    scoop install nodejs
  • Installing from nodist

MacOS

brew install npm

Good practices

  • Avoid installing packages (i.e. using npm install) outside of npm hierarchies (places where no package.json is present). Otherwise this will install the package in your homedirectory which might provoke later collisions.
  • In case of trouble clear your npm cache (refer below)

Task: switch npm version

Once npm is installed, swsitching npm version can be done with npm itself e.g.

npm install -g [email protected]

In a similar fashion updating (to lastest) nom can be done with

npm install npm@latest -g

Ubuntu note: you might need to sudo e.g. sudo npm install -g [email protected]

Cache related issues