2

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.

kissu
  • 40,416
  • 14
  • 65
  • 133
adityaharist
  • 33
  • 1
  • 6
  • More context is highly welcome to help you debug this further. – kissu Nov 09 '22 at 01:10
  • 1
    Please check which version of Node are you using... Simmilar problem found here: https://stackoverflow.com/questions/69394632/webpack-build-failing-with-err-ossl-evp-unsupported – Loki Nov 09 '22 at 01:13
  • Thanks for responding my question. I've checked nodejs, nuxt and npm version : Node.js v18.12.1, Nuxt @ v2.15.8, npm --version 8.19.2. Am I have to downgrade nodejs, and what the best choice for nuxtjs version? thanks for your help sir – adityaharist Nov 09 '22 at 01:27
  • Not sure that Nuxt2 is able to run perfectly at Node 18. Try 16 rather. You can also use yarn to maybe have something more verbose. – kissu Nov 09 '22 at 01:31
  • Thank you. I've just successfully running my nuxtjs project on localhost:3000 by your recommendation. – adityaharist Nov 09 '22 at 02:10
  • for others developer who have the same issue, this might be able to do. 1) uninstall latest nodejs 2) install nodejs specific version (v16.0.0) to use nuxtjs 3) use yarn install then yarn run dev instead npm to have something more verbose. :)) – adityaharist Nov 09 '22 at 02:13
  • I've posted my answer. – kissu Nov 09 '22 at 02:47

1 Answers1

4

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.

kissu
  • 40,416
  • 14
  • 65
  • 133