vue 报错解决方法

nodejs 版本过高导致启动项目失败

 

 控制台输入

$env:NODE_OPTIONS="--openssl-legacy-provider"

重新下载依赖 

npm i

启动项目

npm run dev

 参考  umi项目启动报错node:internal/crypto/hash:71this[kHandle] = new _Hash(algorithm, xofLen);_今夜來看雪的博客-CSDN博客

vue报下面的错,需要用管理员权限打开 vscode

 

 

安装 cnpm

使用淘宝 NPM 镜像定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm:

npm install -g cnpm --registry=https://registry.npmmirror.com

安装 Express 开发框架:

 cnpm install express

参考 NPM 国内慢的问题解决 | 菜鸟教程 (runoob.com)

https://www.runoob.com/w3cnote/npm-slow-use-cnpm.html

解决 cnpm命令报错

 管理员打开PowerShell

 输入 Set-ExecutionPolicy RemoteSigned    更改执行策略为允许运行本地脚本

 或者 Set-ExecutionPolicy Unrestricted    Unrestricted 策略允许运行所有脚本,包括从Internet下载的脚本

 

posted @ 2023-08-16 13:43  一条菜鸡儿  阅读(173)  评论(0)    收藏  举报