Using npm

Using NPM – the Package Manager for Node.js packages

View module version

 
d:\xampp\htdocs\pv\WRApp\test> npm view  selenium-webdriver versions

[ '2.1.0',
   ....
  '4.0.0-alpha  '2.33.2',
  '2.34.0',
  '2.34.1' ].1' ]

D:\xampp\htdocs\pvdata\testSelenium\test> npm view  mocha@4.* version
mocha@4.0.0 '4.0.0'
mocha@4.0.1 '4.0.1'
mocha@4.1.0 '4.1.0'

D:\xampp\htdocs\pvdata\testSelenium\test> npm view  mocha@5.* version
5.0.0

Where does npm install Global packages?

D:\xampp\htdocs\pvdata\wrapp\functionalTesting>  npm root -g 
D:\Users\helmut\AppData\Roaming\npm\node_modules

List Global installed Modules

 
Listed a Certain Global Module 
D:\xampp\htdocs\pvdata\testSelenium\test> npm ls -g browserify
D:\Users\helmut\AppData\Roaming\npm
`-- browserify@15.2.0

Listed All Global Modules 
D:\xampp\htdocs\pvdata\testSelenium\test> npm ls -g | more
D:\Users\helmut\AppData\Roaming\npm
+-- browserify@15.2.0
| +-- assert@1.4.1
| | `-- util@0.10.3 deduped
| +-- browser-pack@6.0.3
| | +-- combine-source-map@0.8.0
| | | +-- convert-source-map@1.1.3
| | | +-- inline-source-map@0.6.2
| | | | `-- source-map@0.5.7 deduped
| | | +-- lodash.memoize@3.0.4
| | | `-- source-map@0.5.7
| | +-- defined@1.0.0 deduped
| | +-- JSONStream@1.3.2 deduped
| | +-- safe-buffer@5.1.1
| | +-- through2@2.0.3 deduped
| | `-- umd@3.0.1
| +-- browser-resolve@1.11.2
...

Install a certain module version

 
D:\xampp\htdocs\pv\WRApp\test> npm install selenium-webdriver@3.6.0
npm WARN saveError ENOENT: no such file or directory, open 'D:\xampp\htdocs\pv\WRApp\test\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'D:\xampp\htdocs\pv\WRApp\test\package.json'
npm WARN test No description
npm WARN test No repository field.
npm WARN test No README data
npm WARN test No license field.

+ selenium-webdriver@3.6.0
added 30 packages in 6.238s

List the top Level modules ONLY

D:\xampp\htdocs\pv\WRApp\test>npm  list  --depth=0
D:\xampp\htdocs\pv\WRApp\test
`-- selenium-webdriver@3.6.0

Un-Install a certain module

D:\xampp\htdocs\pvdata\testSelenium\test> npm -g list --depth=0
D:\Users\helmut\AppData\Roaming\npm
+-- eslint@4.14.0
+-- mocha@4.1.0
`-- selenium-webdriver@4.0.0-alpha.1

D:\xampp\htdocs\pvdata\testSelenium\test> npm uninstall -g selenium-webdriver
removed 30 packages in 4.04s

D:\xampp\htdocs\pvdata\testSelenium\test> npm -g list --depth=0
D:\Users\helmut\AppData\Roaming\npm
+-- eslint@4.14.0
`-- mocha@4.1.0

Reference

A Beginner’s Guide to npm