简体   繁体   English

当我运行“npm run prod”命令时,终端显示“error:03000086:digital envelope routines::initialization error”

[英]Terminal is showing "error:03000086:digital envelope routines::initialization error" when I run "npm run prod" command

I have a vue + laravel application.我有一个 vue + laravel 应用程序。 I need to run the production command using this:我需要使用这个运行生产命令:

npm run prod

but I got this error message:但我收到此错误消息:

opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v17.9.1

I search on google and added this to the package.json scripts key:我在谷歌上搜索并将其添加到 package.json脚本键:

"serve": "vue-cli-service --openssl-legacy-provider serve",
"build": "vue-cli-service --openssl-legacy-provider build",
"lint": "vue-cli-service --openssl-legacy-provider lint"

but stil no solutions.但仍然没有解决方案。 Can you tell me how can I fix it?你能告诉我如何解决吗?

my full package.json file now: https://codeshare.io/3AXbBg我现在完整的 package.json 文件: https://codeshare.io/3AXbBg

I encountered this issue when i updated nodeJs.我在更新 nodeJs 时遇到了这个问题。

I was able to solve it with a similar solution as you stated in the question.我能够使用与您在问题中所述类似的解决方案来解决它。

In my case i have a Laravel/VueJs project so i need to run npm run hot to serve the project in development.在我的例子中,我有一个 Laravel/VueJs 项目,所以我需要运行npm run hot来为开发中的项目服务。

I added NODE_OPTIONS=--openssl-legacy-provider to the hot and prod scripts in package.json.我在 package.json 的hotprod脚本中添加了NODE_OPTIONS=--openssl-legacy-provider

And everything worked fine.一切正常。 Leaving this here in case the anyone needs it.把它留在这里以防万一有人需要它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 支持数字信封例程。 [错误 - 反应] - digital envelope routines upsupported. [Error - React] Angular NPM Run Prod:错误 npm ERR! 缺少脚本:prod - Angular NPM Run Prod: Error npm ERR! missing script: prod 尝试运行 npm 运行开发命令时遇到错误 - Running into error when trying to run npm run dev command 我正在尝试在可视代码中运行命令 npm install 但它向我显示了这个错误 - i am trying to run the command npm install in visual code but it is showing me this error 当我运行“ ng build --prod”时,Angular 6 Build Error - Angular 6 Build Error when i run “ng build --prod” 在 vs 代码终端中编写 npm run start 时如何解决此错误? - how can I fix this error when writing npm run start in vs code terminal? 当我运行“npm install”时,我的终端上出现此错误消息“npm ERR。Linux 5.4.72-microsoft-standard-WSL2” - I have this error message "npm ERR! Linux 5.4.72-microsoft-standard-WSL2" on my terminal when I run "npm install" Angular 2,Node js Error npm run server:prod - Angular 2, Node js Error npm run server:prod 当我运行npm run start时出现此错误 - When I run npm run start I get this error 当我运行 npm 运行构建时出现此错误? - When I run npm run build I get this error?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM