Hello
I am learning node and the node package manager. I understand the npm is to install libraries and packages etc. I understand node.js runtime is what will execute the javascript code but in the tutorial I am following it says to do this
npm install -g npm
This is installing the npm package according to the guide. What is the npm package?
Ive read these pages:
https://www.npmjs.com/
https://www.npmjs.com/package/npm
The first page gives common packages which people install, one of which is npm, a javascript package manager
I thought i had already installed the node package manager with node? Please can you explain the difference between the npm command line tool and the npm package you install with it?
Many thanks
Open in new window
1) npm - script your running
2) install -g - says to install any packages globally, so anyone can use these packages + only root will be able to update these packages
3) package(s) - in your case you're installing the npm package
So this is likely a local npm installation used to install npm globally.
For this to work you'd have to likely add a sudo, like this...
Open in new window
Normally the actual npm command is installed globally in a slightly different manner.
https://github.com/nodesou
Best to follow these instructions to install latest NodeJS + npm.