Npm: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== npm == == install package globally == sudo npm install -g [package] == install package local == Install package to ~/node_modules npm install [package] To install to another folder: # to install into parallel with the .npm cache folder... npm install --prefix ~/.npm [package] # example: npm install --prefix ~/.npm docker-browse This will create: ~/.npm/node_modules/ ~/.npm/node_modules/docker-browse/ ~/.npm/node_modules/several-other-dependecies/ ~/....") |
|||
| Line 23: | Line 23: | ||
~/.npm/package.json | ~/.npm/package.json | ||
~/.npm/package-lock.json | ~/.npm/package-lock.json | ||
Add binary to path: | |||
# example of docker-browse with --prefix used | |||
ln -s ~/.npm/node_modules/docker-browse/ | |||
== Node.js == | == Node.js == | ||
See [[Node.js]] | See [[Node.js]] | ||
Latest revision as of 16:51, 9 March 2026
npm
install package globally
sudo npm install -g [package]
install package local
Install package to ~/node_modules
npm install [package]
To install to another folder:
# to install into parallel with the .npm cache folder... npm install --prefix ~/.npm [package]
# example: npm install --prefix ~/.npm docker-browse
This will create: ~/.npm/node_modules/ ~/.npm/node_modules/docker-browse/ ~/.npm/node_modules/several-other-dependecies/ ~/.npm/package.json ~/.npm/package-lock.json
Add binary to path:
# example of docker-browse with --prefix used ln -s ~/.npm/node_modules/docker-browse/
Node.js
See Node.js