项目问题记录(持续更新)
1.在 yarn install的时候报
error @achrinza/node-ipc@9.2.2: The engine "node" is incompatible with this module. Expected version "8 || 10 || 12 || 14 || 16 || 17". Got "20.1.0"
error Found incompatible module.
需要执行
yarn config set ignore-engines true
忽略版本引擎检测
然后在yarn install
2.npm install安装报错,网络超时-npm ERR! network timeout at: https://registry.npmjs.org/xxx
修改npm仓库源:npm config set registry https://registry.npm.taobao.org/,重新执行npm install成功
设置npm源的几种方式
https://registry.npmjs.org/。 原始源
#设置成淘宝源
npm config set registry https://registry.npm.taobao.org
#查看结果
npm config get registry
#输出结果:
https://registry.npm.taobao.org/
#测试
npm info underscore
使用nrm
npm install -g nrm
列出源的候选项
nrm ls
输出结果:
- npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
taobao ----- https://registry.npm.taobao.org/
nj --------- https://registry.nodejitsu.com/
npmMirror – https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/
使用淘宝源
nrm use taobao
在命令行里指定源:
npm --registry https://registry.npm.taobao.org install [name]
修改 ~/.npmrc
registry = https://registry.npm.taobao.org
使用cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install [name]