npm¶
Install¶
- Npm docs: Install
- Arch npm package
- Manjaro packages: npm
- Issue:
npm10.1.0package ignores thehttps_proxyetc env vars./usr/lib/node_modules/corepack/shims/npmfrom thenodejspackage does honor them. Waiting for npm 10.2.0 to be available from the ManjaroStablerepo.
Global Config / setup¶
Global installation in homdir¶
Show root dirs:
Show prefix dirs:
Install / Upgrade npm¶
Installation paths:
- local:
~/node_modules/.bin/ - global:
~/.npm-global/bin/
Install npm modules locally, not as root¶
Resolving EACCES permissions errors when installing packages globally
Install from git repos¶
npm install git+https://0xacab.org/varac-projects/jsonresume-theme-varac.git # https
npm install git+ssh://git@0xacab.org/varac-projects/jsonresume-theme-varac.git # ssh
Install a specific branch:
Short Github ref:
Upgrade module¶
Update package-lock.json¶
Update package-lock.json after updating versions in package.json:
Audit security vulnerabilities¶
npx¶
Introducing npx: an npm package runner
Yarn¶
Until this Debian ITP got resolved:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo tee /etc/apt/trusted.gpg.d/yarn.asc
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install yarn
Config at ~/.yarnrc