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

error:0308010C:digital envelope routines::unsupported #32

Closed
kayx23 opened this issue Mar 5, 2023 · 3 comments
Closed

error:0308010C:digital envelope routines::unsupported #32

kayx23 opened this issue Mar 5, 2023 · 3 comments

Comments

@kayx23
Copy link
Owner

kayx23 commented Mar 5, 2023

Error when starting with gatsby develop:

Error: error:0308010C:digital envelope routines::unsupported
  
  - hash:71 new Hash
    node:internal/crypto/hash:71:19
  
  - node:crypto:133 Object.createHash
    node:crypto:133:10

...
@kayx23
Copy link
Owner Author

kayx23 commented Mar 5, 2023

Use --openssl-legacy-provider

source: https://stackoverflow.com/a/69699772

or npm audit fix --force

Reason For The Error

In Node.js v17, the Node.js developers closed a security hole in the SSL provider. This fix was a breaking change that corresponded with similar breaking changes in the SSL packages in NPM. When you attempt to use SSL in Node.js v17 or later without also upgrading those SSL packages in your package.json, then you will see this error.

@kayx23 kayx23 closed this as completed Mar 5, 2023
@kayx23 kayx23 pinned this issue Mar 5, 2023
@kayx23
Copy link
Owner Author

kayx23 commented Mar 5, 2023

node --openssl-legacy-provider node_modules/.bin/gatsby build
node --openssl-legacy-provider node_modules/.bin/gatsby develop

gatsbyjs/gatsby#33723 (comment)

@kayx23 kayx23 reopened this Mar 5, 2023
@kayx23
Copy link
Owner Author

kayx23 commented Mar 5, 2023

Alternatively, set the engine field in your package.json and set requirement for node to v16:

"engines" : { 
    "node" : ">=16.0.0 <17.0.0"
}

To enforce this via npm you need to create an .npmrc file with the value:

engine-strict=true

This raises an error for not having the right version of node when users run npm install

https://stackoverflow.com/a/29349773

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

No branches or pull requests

1 participant