问题:
在pc端代码执行npm install 的时候,报错 node 'fs'
处理方法:
1. PC端代码不限制 node 版本, 所以执行的时候遇到报错信息,可以网上查询资料调整;
2. 报错 node fs 主要的问题是,node版本过低导致的, 可以尝试升级node来解决;
3. 还可以考虑更换镜像源;
查看镜像源:
npm config get registry
更换镜像源:
淘宝: npm config set registry https://registry.npmmirror.com
腾讯: npm config set registry https://mirrors.cloud.tencent.com/npm
华为: npm config set registry https://repo.huaweicloud.com/repository/npm/
官方:npm config set registry https://registry.npmjs.org/
4. 如果尝试还是不行,可能就是因为被墙的问题,可以考虑加速器等工具。