Skip to content

Instantly share code, notes, and snippets.

@gaearon
Created January 8, 2018 17:02
Show Gist options
  • Save gaearon/4064d3c23a77c74a3614c498a8bb1c5f to your computer and use it in GitHub Desktop.
Save gaearon/4064d3c23a77c74a3614c498a8bb1c5f to your computer and use it in GitHub Desktop.
Creating a new project with npm <= 5.2

If you use npm 5.1 or earlier, you can't use npx. Instead, install create-react-app globally:

npm install -g create-react-app

Now you can run:

create-react-app my-app
@25thOliver
Copy link

errr please help

@ArnoldFlexy
Copy link

Hi

The error in the image is related to an issue with Node.js's OpenSSL module, specifically regarding digital envelope routines:unsupported. This often occurs when the version of OpenSSL bundled with Node.js is incompatible with certain modules or cryptographic functions being used by the project.

Here are a few steps to resolve this issue:

  1. Upgrade react-scripts: Sometimes, older versions of react-scripts can cause compatibility issues. Try updating react-scripts to the latest version:

npm install react-scripts@latest

  1. Downgrade Node.js Version: If you're using Node.js version 20.x, it may not be compatible with some older packages. Try downgrading Node.js to an LTS version (such as 18.x or 16.x):

nvm install 18
nvm use 18

  1. Set OpenSSL Legacy Provider: Newer versions of Node.js have stricter defaults for OpenSSL. You can force Node.js to use legacy OpenSSL providers by setting the following environment variable:

export NODE_OPTIONS=--openssl-legacy-provider

Alternatively, you can add it directly to your package.json start script:

"scripts": {
"start": "react-scripts start --openssl-legacy-provider"
}

  1. Reinstall Node Modules: After making any of the above changes, it's a good idea to delete the node_modules folder and package-lock.json file and then reinstall the dependencies:

rm -rf node_modules package-lock.json
npm install

Try one or more of these solutions to resolve the issue.

@25thOliver
Copy link

25thOliver commented Oct 22, 2024 via email

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