[英]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 的
hot
和prod
脚本中添加了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.