Learn how to update NPM?
> node -v
> npm -v
npm install installs the package and all other packages that it depends on. If the package has a package-lock or shrinkwrap file, the installation of dependencies will be driven from those files.
A package is defined as follows:
a) a folder containing a program described by a package.json file
b) a gzipped tarball containing (a)
c) a URL that resolves to (b)
d) a <name>@<version> that is published on the registry (see npm-registry) with (c)
e) a <name>@<tag> (see npm-dist-tag) that points to (d)
f) a <name>that has a “latest” tag satisfying (e)
g) a <git remote url> that resolves to (a)
“npm install” installs the dependencies in the local node_modules folder. With -g or –global appended to the command. It installs the current package as a global package. By default, “npm install” will install all modules listed as dependencies in package.json
The -f or –force argument will force npm to fetch remote resources even if a local copy exists on disk.
npm install sax –force
NPM is a different project from Node.js. As a result, even if you’ve just downloaded Node.js, you’ll probably need to update your NPM. Luckily, NPM knows how to update itself. To update it, type this command into your terminal:
> npm install npm@latest -g
In place of the latest keyword, you can specify the version number as well, that you want to install. Otherwise, by default, the latest version of NPM will be installed.