【vue】vue2项目将npm包管理器修改为yarn包管理器
1.删除node_modules文件夹、package-lock.json文件
2.全局安装yarn
shell
npm install -g yarn
3.安装项目依赖
shell
yarn install
如果执行yarn install 报类似以下这种版本不兼容错误,执行 yarn config set ignore-engines true
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.12.1"
yarn config set ignore-engines true
shell
yarn config set ignore-engines true
4.启动项目
shell
yarn run dev
执行 yarn run serve 报类似以下这种 ,需要单独安装 core-js,版本可以在package.js文件中查找
To install them, you can run: npm install --save core-js/modules/es.array.push.js core-js/modules/es.error.cause.js core-js/modules/es.object.proto.js core-js/modules/es.regexp.dot-all.js core-js/modules/web.url-search-params.delete.js core-js/modules/web.url-search-params.has.js core-js/modules/web.url-search-params.size.js
Error from chokidar (D:): Error: EBUSY: resource busy or locked, lstat 'D:\DumpStack.log.tmp'
shell
npm install core-js@3.6.5
yarn add core-js@3.6.5
5.重新启动项目
shell
yarn run dev