当npm运行dev时new _Hash(算法,xofLen)

xqkwcwgp  于 2023-01-05  发布在  其他
关注(0)|答案(2)|浏览(668)
╭───────────────────────────────────────╮
   │                                       │
   │   Nuxt @ v2.15.8                      │
   │                                       │
   │   ▸ Environment: development          │
   │   ▸ Rendering:   server-side          │
   │   ▸ Target:      server               │
   │                                       │
   │   Listening: http://localhost:3000/   │
   │                                       │
   ╰───────────────────────────────────────╯

i Preparing project for development                                           17:35:26
i Initial build may take a while                                              17:35:26
i Discovered Components: .nuxt/components/readme.md                           17:35:26
√ Builder initialized                                                         17:35:26
√ Nuxt files generated                                                        17:35:26

* Client █████████████████████████ building (10%) 1/2 modules 1 active
 node_modules\webpack-hot-middleware\client.js

* Server █████████████████████████ building (10%) 1/1 modules 0 active

node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (F:\1.A software Company careers test\CyberElysium\test\todo-nuxt\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (F:\1.A software Company careers test\CyberElysium\test\todo-nuxt\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (F:\1.A software Company careers test\CyberElysium\test\todo-nuxt\node_modules\webpack\lib\NormalModule.js:471:10)
    at F:\1.A software Company careers test\CyberElysium\test\todo-nuxt\node_modules\webpack\lib\NormalModule.js:503:5
    at F:\1.A software Company careers test\CyberElysium\test\todo-nuxt\node_modules\webpack\lib\NormalModule.js:358:12
    at F:\1.A software Company careers test\CyberElysium\test\todo-nuxt\node_modules\web    at iterateNormalLoaders (F:\1.A software Company careers test\CyberElysium\test\todo-nuxt\node_modules\webpack\node_modules\loader-runner\lib\LoaderRunner.js:214:10)       
    at Array.<anonymous> (F:\1.A software Company careers test\CyberElysium\test\todo-nuxt\node_modules\webpack\node_modules\loader-runner\lib\LoaderRunner.js:205:4) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' 
],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
w6lpcovy

w6lpcovy1#

您需要切换到较低的节点版本,尝试使用节点v14。

8ehkhllq

8ehkhllq2#

我在尝试使用Ionic运行一个Angular应用程序时也遇到了同样的问题,我将我使用的Node.js版本降级到了v16.13.0,到目前为止,它对我来说是有效的。
如果使用的是NVM(节点版本管理器),请使用以下命令执行安装:

  1. nvm install 16.13.0
  2. nvm use 16.13.0

相关问题