系统中安装了多个 node 版本,使用 nvm 管理 node,安装配置码良前端时频繁出现问题。
必备条件
需要 python2.7、visual studio 2017 的 C++ 组件
node 需要使用 10.x 版本,11、12 甚至更高的都不行。
问题解决
-
安装过程中经常出现运行 yarn 编译时出现乱码
参考这篇解决,原因是 package.json 中设置的 node-sass 和 sass-loader 版本:https://blog.csdn.net/m0_67392126/article/details/126113751 -
The engine "node" is incompatible with this module.
切换到了10.x 还会提示The engine “node“ is incompatible with this module.
参考这篇解决:https://blog.csdn.net/qq_40677969/article/details/126938462
就是使用 npm install 代替 yarn 安装的依赖包。
也可以参考下:https://blog.csdn.net/zp357252539/article/details/123259529 (这个我没试) -
Cannot read property 'range' of null
es-lint 的相关问题,将 package.json 中的 "babel-eslint": 10.x 修改为了稳定版本 babel-eslint 7.2.3
更多精彩内容:各种AI课程、技能课程、黑科技软件、网站小程序源码、副业小项目、PPT模板等精品素材、电商课程、推广引流课程等,尽在 天边资源网 。