Npm is the package manager that is packaged/installed with a node installation.
To update npm self, execute the following statement:
npm install npm@latest -g
C:\Users\gerard\AppData\Roaming\npm\npm -> C:\Users\gerard\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
C:\Users\gerard\AppData\Roaming\npm
`-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
........................
npx upgrade with npm
npm -v
4.5.0
See What are npm scripts and how to use them ? The script property of Package.json
npm gets its config settings from:
The npm config command can be used to update and edit the contents of the user and global npmrc files.
Npm reads configuration from any environment variables beginning with NPM_CONFIG.
The .npmrc file is in your project’s root.
npm config get userconfig # defaults to ~/.npmrc
C:\Users\gerard\.npmrc
npm config get globalconfig # defaults to /usr/local/etc/npmrc
C:\Users\gerard\AppData\Roaming\npm\etc\npmrc
npm config get registry
https://registry.npmjs.org/
npm config get prefix
C:\Users\foo\AppData\Roaming\npm
Prior to npm@3, the node_modules dependency structure had its own node_modules folder with all of its dependencies specified in package.json.
node_modules
└─ foo
├─ index.js
├─ package.json
└─ node_modules
└─ bar
├─ index.js
└─ package.json
With npm@3 the node_modules structure is now flat:
node_modules
├─ foo
| ├─ index.js
| └─ package.json
└─ bar
├─ index.js
└─ package.json
Source code may require dependencies that are not added as dependencies to the project.