Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to serve with Node v17.0.1 #6770

Closed
Miguel-Bento-Github opened this issue Oct 21, 2021 · 26 comments
Closed

Impossible to serve with Node v17.0.1 #6770

Miguel-Bento-Github opened this issue Oct 21, 2021 · 26 comments

Comments

@Miguel-Bento-Github
Copy link

Version

5.0.0-beta.6

Environment info

Environment Info:

  System:
    OS: macOS 11.5.2
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 17.0.1 - /usr/local/bin/node
    Yarn: 1.22.15 - /opt/homebrew/bin/yarn
    npm: 8.1.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 94.0.4606.81
    Edge: Not Found
    Firefox: 92.0
    Safari: 14.1.2
  npmPackages:
    @intlify/vue-devtools:  9.1.9 
    @intlify/vue-i18n-loader: 3.2.0 => 3.2.0 
    @storybook/vue3: 6.3.12 => 6.3.12 
    @vue/babel-helper-vue-jsx-merge-props:  1.2.1 
    @vue/babel-helper-vue-transform-on:  1.0.2 
    @vue/babel-plugin-jsx:  1.1.1 
    @vue/babel-plugin-transform-vue-jsx:  1.2.1 
    @vue/babel-preset-app:  5.0.0-beta.6 
    @vue/babel-preset-jsx:  1.2.4 
    @vue/babel-sugar-composition-api-inject-h:  1.2.1 
    @vue/babel-sugar-composition-api-render-instance:  1.2.4 
    @vue/babel-sugar-functional-vue:  1.2.2 
    @vue/babel-sugar-inject-h:  1.2.2 
    @vue/babel-sugar-v-model:  1.2.3 
    @vue/babel-sugar-v-on:  1.2.3 
    @vue/cli-overlay:  5.0.0-beta.6 
    @vue/cli-plugin-babel: 5.0.0-beta.6 => 5.0.0-beta.6 
    @vue/cli-plugin-e2e-cypress: 5.0.0-beta.6 => 5.0.0-beta.6 
    @vue/cli-plugin-eslint: 5.0.0-beta.6 => 5.0.0-beta.6 
    @vue/cli-plugin-router: 5.0.0-beta.6 => 5.0.0-beta.6 
    @vue/cli-plugin-typescript: 5.0.0-beta.6 => 5.0.0-beta.6 
    @vue/cli-plugin-unit-jest: 5.0.0-beta.6 => 5.0.0-beta.6 
    @vue/cli-plugin-vuex: 5.0.0-beta.6 => 5.0.0-beta.6 
    @vue/cli-service: 5.0.0-beta.6 => 5.0.0-beta.6 
    @vue/cli-shared-utils:  5.0.0-beta.6 
    @vue/compiler-core:  3.2.20 
    @vue/compiler-dom:  3.2.20 
    @vue/compiler-sfc: 3.2.20 => 3.2.20 
    @vue/compiler-ssr:  3.2.20 
    @vue/component-compiler-utils:  3.2.2 
    @vue/devtools-api:  6.0.0-beta.19 
    @vue/eslint-config-prettier: 6.0.0 => 6.0.0 
    @vue/eslint-config-typescript: 8.0.0 => 8.0.0 
    @vue/reactivity:  3.2.20 
    @vue/ref-transform:  3.2.20 
    @vue/runtime-core:  3.2.20 
    @vue/runtime-dom:  3.2.20 
    @vue/server-renderer:  3.2.20 
    @vue/shared:  3.2.20 
    @vue/test-utils: 2.0.0-rc.16 => 2.0.0-rc.16 
    @vue/vue3-jest: 27.0.0-alpha.1 => 27.0.0-alpha.1 
    @vue/web-component-wrapper:  1.3.0 
    eslint-plugin-vue: 7.20.0 => 7.20.0 
    jest-serializer-vue:  2.0.2 
    typescript: 4.4.4 => 4.4.4 
    vue: 3.2.20 => 3.2.20 (2.6.14)
    vue-cli-plugin-i18n: 2.3.1 => 2.3.1 
    vue-docgen-api:  4.41.2 
    vue-docgen-loader:  undefined (1.5.0)
    vue-eslint-parser:  7.11.0 
    vue-hot-reload-api:  2.3.4 
    vue-i18n: 9.1.9 => 9.1.9 (8.26.5)
    vue-i18n-extract:  1.0.2 
    vue-inbrowser-compiler-utils:  4.41.2 
    vue-loader: 16.8.1 => 16.8.1 (15.9.8)
    vue-router: 4.0.12 => 4.0.12 
    vue-style-loader:  4.1.3 
    vue-template-es2015-compiler:  1.9.1 
    vue3-click-away: 1.2.1 => 1.2.1 
    vuex: 4.0.2 => 4.0.2 
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  • Update to Node v17.0.1
  • Create a new vue 3 app through the cli
  • run vue-cli-service serve script

What is expected?

Normal compilation of the app

What is actually happening?

Exit code 1

The following object appears in the console

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

From https://medium.com/the-node-js-collection/node-js-17-is-here-8dba1e14e382
we can see this issue is due to Open SSL 3.0

From the article:

"If you hit an ERR_OSSL_EVP_UNSUPPORTED error in your application with Node.js 17, it’s likely that your application or a module you’re using is attempting to use an algorithm or key size which is no longer allowed by default with OpenSSL 3.0. A new command-line option, --openssl-legacy-provider, has been added to revert to the legacy provider as a temporary workaround for these tightened restrictions."

@sodatea
Copy link
Member

sodatea commented Oct 21, 2021

Seems a webpack issue webpack/webpack#14532 (comment)

@wunderdaz
Copy link

Also running into this issue while trying to build a plugin:

npx vue-cli-service build --target lib --formats umd-min --no-clean --dest assets/ --name "XXXXXX.[chunkhash]" src/plugin/YYYYYY/ZZZZZ.vue
-  Building for production as library (umd-min)...
node:internal/crypto/hash:67
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported

@sodatea
Copy link
Member

sodatea commented Oct 26, 2021

Fixed in v5.0.0-beta.7

@sodatea sodatea closed this as completed Oct 26, 2021
@mrichman
Copy link

mrichman commented Nov 4, 2021

export NODE_OPTIONS=--openssl-legacy-provider fixes it for me.

@cyber-netics
Copy link

Downgrading to Node:16.13.0 worked for me

@paulxtiseo
Copy link

paulxtiseo commented Nov 9, 2021

Fixed in v5.0.0-beta.7

I just uninstalled @vue/cli 4.5.15 and installed @vue/cli 5.0.0-rc.0 and am getting the error, under NodeJS 17.0.1. The solution presented by @mrichman worked for me, but I worry about making sure to remove this in timely way when webpack/openssl resolve this...

@sergiocabral
Copy link

export NODE_OPTIONS=--openssl-legacy-provider fixes it for me.

Works for me with:

  • Node v. 17.1.0
  • @vue/cli v. 4.5.15
  • PowerShell 7.2.0
  • Windows 10 v. 20H2

@paulxtiseo
Copy link

@sergiocabral, I have seen that solution, but I also thought it had been addressed in v5.0.0-beta.7 per @sodatea?

@mhavid
Copy link

mhavid commented Nov 30, 2021

@Miguel-Bento-Github
change script in pancake.json with
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build"

@Miguel-Bento-Github
Copy link
Author

@mhavid You are commenting on a closed issue that has already been fixed.

@K4L231
Copy link

K4L231 commented Dec 2, 2021

@Miguel-Bento-Github change script in pancake.json with "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build"

THIS IS LEGIT ONLY ONE THING THAT WORKED!!!!!! THANK YOU

@jaredmeadowsLB
Copy link

the SET NODE_OPTIONS strategy didn't work for me 😔, but what DID work was....
"serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
(I just squished together @mrichman's fix and @mhavid, so credit to them!)

@ffmit
Copy link

ffmit commented Jan 17, 2022

On Windows who can do this on CMD using
set NODE_OPTIONS=--openssl-legacy-provider

@raja-chaudhary
Copy link

the SET NODE_OPTIONS strategy didn't work for me pensive, but what DID work was.... "serve": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", "build": "export NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", (I just squished together @mrichman's fix and @mhavid, so credit to them!)

I have updated this in my package.json but I have not pushed the package.json file to my heroku. I want to ask, will pushing this code to my heroku master break the website or is it safe to do so? I am asking because ever since I have upgraded to node v17.3.1 I have noticed a lot of dependencies have updated in my package-lock.json. I am not sure if updating and pushing both these files will build a functioning version on my live heroku server as well.

@wunderdaz
Copy link

@raja-chaudhary unfortunately that's a risk-weight analysis you need to do yourself, no one here can give you the answer to that. Just try on another test instance and see if it works.

It's easy if you have a staging environment ;)

@Voucik
Copy link

Voucik commented Jan 30, 2022

On Windows who can do this on CMD using set NODE_OPTIONS=--openssl-legacy-provider

It's not work in Windows cmd.
Thes help for me:
1

"scripts": {
    "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", 
    "build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
    "lint": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service lint"
  },

@Sazzad-Saju
Copy link

Same issue with me, solved by doing this: unistall node.js. Install node v16.13.2 with additional components. Now again run npm run serve project will open on http://localhost:8080/

@larodiel
Copy link

SET NODE_OPTIONS=--openssl-legacy-provider

It worked, I just had to change SET to export on mac

@avi9111
Copy link

avi9111 commented Apr 30, 2022

Thanks, @Voucik, I used "SET NODE_OPTIONS ", it was Done for me

@kamalud
Copy link

kamalud commented Nov 26, 2022

not working yet

@leolux
Copy link

leolux commented Mar 18, 2023

export NODE_OPTIONS=--openssl-legacy-provider

Where to add this line?

@MarcelJurtz
Copy link

export NODE_OPTIONS=--openssl-legacy-provider

Where to add this line?

@leolux in the package.json to the build scripts.

@Gurushesh-Metapercept
Copy link

how to add this environment variable in Firebase Hosting CICD ?

unset NODE_OPTIONS

@Glideh
Copy link

Glideh commented Sep 26, 2023

Using Docker, I had to add

ENV NODE_OPTIONS=--openssl-legacy-provider

in my Dockerfile

@coreysyms
Copy link

coreysyms commented Oct 25, 2023

Nuxt / Node 18 being deployed on AWS Elastic BeanStalk. I needed to create a predeploy hook with the flag to get it to run. package.json scripts update did not work for me. But the below method did.

.platform > hooks > predeploy > 01_build.sh
#!/bin/bash
export NODE_OPTIONS=--openssl-legacy-provider
npm run build

@ramrasu88
Copy link

what voucik has said helped me
we have to set the options mentioned by him/her in package.json file of vuejs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests