2021年2月22日 作者 zeroheart

npm相关记录

1.如果出现stack Error: `gyp` failed with exit code: 1

npm i -g node-gyp

也可以尝试升级node版本

2.出现Maximum call stack size exceeded

升级npm
npm i -g n --force
sudo n stable 

npm install -g npm
npm cache clean --force
npm install

3.出现Cannot read property ‘xxxxx’ of undefined

rm -rf node_modules 
rm package-lock.json 
npm cache clear --force 
npm install

4.设置镜像

npm config set registry https://registry.npm.taobao.org

npm config set registry https://registry.npmjs.org