Home > other >  Nuxt2 doesn't work with latest LTS of node (v18)
Nuxt2 doesn't work with latest LTS of node (v18)

Time:11-09

I'm newbie and this my first vuejs project using nuxt. I running command by "npm run dev" in CMD, after run command "npm install" for my project and got this:

* 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);
                  ^ttp://localhost:3000/   │
   │                                       │
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)                                        07:49:12
    at module.exports (C:\Users\a\revampkiriminaja\kiriminaja\node_modules\webpack\lib\util\createHash.js:135:53)                                                              07:49:12
    at NormalModule._initBuildHash (C:\Users\a\revampkiriminaja\kiriminaja\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (C:\Users\a\revampkiriminaja\kiriminaja\node_modules\webpack\lib\NormalModule.js:471:10)
    at C:\Users\a\revampkiriminaja\kiriminaja\node_modules\webpack\lib\NormalModule.js:503:5
    at C:\Users\a\revampkiriminaja\kiriminaja\node_modules\webpack\lib\NormalModule.js:358:12
    at C:\Users\a\revampkiriminaja\kiriminaja\node_modules\webpack\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (C:\Users\a\revampkiriminaja\kiriminaja\node_modules\webpack\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at Array.<anonymous> (C:\Users\a\revampkiriminaja\kiriminaja\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'
}

PS: I am able to run serve and get a working localhost:3000 in my browser.

CodePudding user response:

OP solved the issue by using Node v16, I recommend to use nvm for such purpose btw.
The LTS aka Node.js v18 seems to be too new for Nuxt2.

PS: using yarn or PNPM will give more verbose feedback overall as of what is happening during your packages installation.

  • Related