digital envelope routines::unsupported

D:\workspace\vuedemo> npm run dev
...
error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:133:10)
...

Nodejs升级到17版本以上时,运行之前的webpack项目会出现此问题。详情查看 github

解决办法有两种:

  1. 修改 package.json,在相关构建命令之前加入 set NODE_OPTIONS=–openssl-legacy-provider &
    "scripts": {
    "serve": "set NODE_OPTIONS=–openssl-legacy-provider & vue-cli-service serve",
    "build": "set NODE_OPTIONS=–openssl-legacy-provider & vue-cli-service build",
    "lint": "set NODE_OPTIONS=–openssl-legacy-provider & vue-cli-service lint"
    }
  2. 回退Nodejs版本,可以使用 nvm管理工具,管理多个Nodejs版本。

◉ 终端输入vue -V 报错 在此系统上禁止运行脚本

C:\Users\Administrator> vue -V
vue : 无法加载文件 D:\nodejs\node_global\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ vue -V
+ ~~~
+ CategoryInfo : SecurityError: (:) [],PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

解决办法:

  1. 使用管理员模式启动终端
  2. 执行命令:get-ExecutionPolicy(取得shell的当前执行策略),显示 Restricted(表示状态是禁止的)
  3. 执行命令:set-ExecutionPolicy RemoteSigned
  4. 执行命令:get-ExecutionPolicy,显示 RemoteSigned 则可以正常使用了

Node Sass does not yet support your current environment

Syntax Error: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (108)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.14.1

node sass 版本和当前node版本不匹配,点击查看匹配版本

解决办法:

  1. 卸载当前版本 node sass
npm uninstall --save node-sass
  1. 安装对应版本的 node sass
npm install --save node-sass@版本

最新文章

  1. Cannot open the disk 'D:\Program Files\VMOS\Centos.vmdk' or one of the snapshot disks it depends on
  2. Log4net对文件的支持
  3. java基础---->java中正则表达式二
  4. DataSet DataTable操作
  5. How to use BMW Multi Tool 7.3 to replace lost key for BMW X1
  6. 如何将磁盘从GPT格式转换成MBR
  7. JVM参数设置、分析
  8. .9-浅析express源码之请求处理流程(2)
  9. IDEA与eclipse:vm参数调优笔记
  10. react rem
  11. vs2012密钥
  12. wireshark抓包工具详细说明及操作使用
  13. MUI 选项卡切换+下拉刷新动态 完整实现一例
  14. selenium自动化测试多条数据选择第一条
  15. db2执行计划介绍
  16. js写法【3】
  17. stl学习记录(2)
  18. Android:Dialog中隐藏键盘的注意事项
  19. fsocket发送post实现异步请求
  20. Mahout学习之Mahout简单介绍、安装、配置、入门程序測试

热门文章

  1. Dropout----Dropout来源
  2. PHP cURL抓取网上图片
  3. 齐博x1.2万能参数配置接口
  4. HTML躬行记(3)——WebRTC视频通话
  5. spring-属性注入(外部bean方式)
  6. Python基础之函数:2、globlal与nonlocal和闭包函数、装饰器、语法糖
  7. Angular SSR 探究
  8. Perl语言中一些内置变量等,$x、qw、cmp、eq、ne等
  9. golang内置包管理工具go mod简明教程
  10. go mod常用命令 已经 常见问题