1,用npm安装报错 reason: getaddrinfo ENOTFOUND server server:80 (代理器设置问题)以及npm+指令没有反应的问题
在用npm安装cnpm和其他包的时候总是报错
C:\Users\Lz-Studio>npm install -g cnpm --registry=https://registry.npm.taobao.org
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npm.taobao.org/cnpm failed, reason: getaddrinfo ENOTFOUND server server:80
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! D:\SoftWare\Node.js_10.15.3\node_cache\_logs\2019-04-06T12_37_40_953Z-debug.log
解决办法:
1、执行:
npm config get proxy
npm config get https-proxy
如果返回值不为null,继续执行: (这一步很重要,一定要保证两个命令的返回值都为null,话说回来,应该出现这个错误这两个返回值有不为null的)(这里博主两个都不为null)
npm config set proxy null
npm config set https-proxy null
2、执行: npm config set registry http://registry.cnpmjs.org/
3、安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
然后就可以用ncpm安装其他包了
2,在命令行里运行npm install命令,却提示不是内部或外部命令。
已经下载安装了nodejs,应该还需要设置一下环境变量
3,Error: EBUSY: resource busy or locked, symlink 的解决办法
当我们在npm i 安装依赖的时候,会遇到这个Error: EBUSY: resource busy or locked, symlink....的问题。解决的 办法就是关掉电脑的杀毒软件,比如360 等等。