1、下载依赖时: npm install
可能出现权限问题
首先设置vscode以管理员身份打开
也可以直接设置属性
这个时候还报错
npm ERR! code ERESOLVE
npm ERR!
npm ERR! Found: @babel/core@7.0.0
npm ERR! node_modules/@babel/core
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
2、改用cnpm install
报错
cnpm : 无法加载文件 D:\soft\nodejs\node_global\cnpm.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.
com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
vscode终端设置: set-ExecutionPolicy RemoteSigned
最终运行成功