NPM err! Code enotfound (2020-07-03)

 
VUE project install dependency package, error as follows:

$ npm install
npm WARN registry Using stale data from https://registry.npmjs.org/ because the host is inaccessible -- are you offline?
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN deprecated [email protected]: [email protected]<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of [email protected]
npm WARN deprecated [email protected]: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/vue-router/-/vue-router-3.3.4.tgz failed, reason: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network 
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/luminal/.npm/_logs/2020-07-03T04_12_04_809Z-debug.log

Solution:

$ npm config get proxy
null
$ npm config get https-proxy
null

$ npm config set proxy null
$ npm config set https-proxy null
$ npm config set registry http://registry.cnpmjs.org/
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
/Users/luminal/.nvm/versions/node/v10.16.0/bin/cnpm -> /Users/luminal/.nvm/versions/node/v10.16.0/lib/node_modules/cnpm/bin/cnpm
+ [email protected]
updated 5 packages in 12.316s

$ cnpm i
bash: cnpm: command not found
$ cnpm install
bash: cnpm: command not found
$ nvm use v10.16.0
Now using node v10.16.0 (npm v6.9.0)
$ cnpm i
⠧ [6/23] Installing [email protected]^2.0.0
WARN node unsupported "[email protected]" is incompatible with [email protected][email protected][email protected][email protected]^2.0.0, expected [email protected]<8.10.0
✔ Installed 23 packages
✔ Linked 750 latest versions

Having previously managed the Node version using NVM, you need to specify the following version: NVM USE v10.16.0
Then use CNPM I or CNPM install
 
Reference link:
NPM installs an error solution for any package
 
 
 


Read More: