npm
npm, and Solutions.
ERESOLVE unable to resolve dependency tree
: npm install
:(npm 7+ )
Solutions:
- : npm install --legacy-peer-deps
- : npm install --force
- :,
- overrides: package.json "overrides"
: New,
EACCES: permission denied
: npm install -g
:npm root
Solutions:
- Recommended: nvm Node()
- npm prefix: mkdir ~/.npm-global && npm config set prefix ~/.npm-global
- ~/.npm-global/bin PATH
- : sudo npm install -g(Recommended)
: nvm Node.js,
npm ERR! network request to https://registry.npmjs.org failed
: npm install
:, DNS,
Solutions:
- : npm config set registry https://registry.npmmirror.com
- : npm config set proxy http://127.0.0.1:7890
- : npm cache clean --force && npm install
- DNS: nslookup registry.npmjs.org
: Developer npmmirror
Error: Cannot find module 'xxx'
: Node.js
:, node_modules,
Solutions:
- New: rm -rf node_modules && npm install
- package.json : npm ls <package>
- command: npm install -g <package>
- require/import
: package.json,
npm WARN EBADENGINE Unsupported engine
: npm install Node.js
:Node.js
Solutions:
- : npm info <package> engines
- Node.js: nvm install <version> && nvm use <version>
- (): npm install --ignore-engines
- .nvmrc Node
:.nvmrc, Node.js