踩的坑,记录下来,虽然有点波折,但是成功了,嗨皮!
1、

1、yarn install报错

解决方式有两种:
1.在git bash窗口里面
执行命令:
$ git config --system http.sslcainfo "D:/Git/mingw64/ssl/certs/ca-bundle.crt"
2.注意:忽略ssl认证
$ git config --system htt.sslverify false
*命令行工具关掉重新打开;

2、yarn global add @vue/cli
-
报错
图片.png
-
用管理员权限打开命令行工具,重新装@vue/cli,报如下的错
图片.png
yarn config set ignore-engines true
关掉命令行工具,重新以管理员权限打开命令行工具,在执行一次
yarn global add @vue/cli

启动开发环境:
yarn run serve

成功了,太不容易了!
2、npm install

方法1、
需要删除npmrc文件。
强调:不是nodejs安装目录npm模块下的那个npmrc文件
而是在C:\Users{账户}\下的.npmrc文件..
方法2、
或者直接用命令清理就行,控制台输入:
npm cache clean --force
3、 vue项目用yarn安装依赖时, 出现fsevents@1.2.4模块不兼容的问题
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
error eslint@5.11.1: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "8.9.1"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
解决方法

2、yarn config set ignore-engines true
4、解决缺失 core-js 的问题,遇到core-js/modules/es6.regexp.replace 问题
yarn add core-js@3.6.4 --save
网友评论