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

npm run setup fails #3062

Open
MichaelSel opened this issue May 15, 2022 · 3 comments
Open

npm run setup fails #3062

MichaelSel opened this issue May 15, 2022 · 3 comments

Comments

@MichaelSel
Copy link

MichaelSel commented May 15, 2022

Description

npm run setup fails with npm v8.10.0 and node v18.1.0
Instead, it yields a ERESOLVE unable to resolve dependency tree error.

Running it with the --legacy-peer-deps flag produces

npm ERR! code ETARGET
npm ERR! notarget No matching version found for minimist@4.3.0. 

Steps to reproduce

On a windows machine (perhaps on other operating systems as well) typing npm run setup into terminal results in an error.

Expected behavior
The initial setup of the project should execute

Screenshots
image

Versions

  • React-Boilerplate: 4.0.0
  • Node/NPM: v18.1.0 / v8.10.0
  • Browser: N/A
@MichaelSel
Copy link
Author

MichaelSel commented May 15, 2022

Downgrading to Node v16.15.0

In package.json I added the --legacy-peer-deps flag to "presetup": "npm i chalk shelljs"
I added the same flag in /internals/scripts/setup after npm install
Finally, back in package.json I added

NODE_OPTIONS=--openssl-legacy-provider to the start script.

This solves it for me.

@muntiMedia
Copy link

muntiMedia commented Jul 18, 2022

reinstall node or clean the catches
npm cache clean --force

and then npm add --legacy-peer-deps

@Rajatsinha05
Copy link

To address this, you can try a few troubleshooting steps:

  1. Clear npm cache: Sometimes, outdated or corrupted packages in the npm cache can cause dependency resolution issues. Try clearing the npm cache by running:

    npm cache clean --force
    
  2. Update npm and Node.js: Ensure that you're using the latest versions of npm and Node.js, as newer versions often include bug fixes and improvements related to dependency resolution. You can update npm using:

    npm install -g npm@latest
    

    And Node.js from the official website or using a version manager like nvm (Node Version Manager) or nvm-windows.

  3. Check package.json: Review your project's package.json file to ensure that the specified versions of dependencies are compatible with npm 8 and Node.js 18. You may need to update the versions of dependencies or use peer dependency overrides.

  4. Use --legacy-peer-deps flag: Since npm 7, stricter peer dependency rules have been enforced. Using the --legacy-peer-deps flag might help in resolving the issue by reverting to the previous behavior of ignoring peer dependency constraints. Run:

    npm install --legacy-peer-deps
    
  5. Manually install missing dependency: If the issue persists, and it's specifically related to the minimist package, you can try manually installing it at a compatible version. For example:

    npm install minimist@latest
    

After trying these steps, attempt to run npm run setup again and see if the issue is resolved. If the problem persists, it might be beneficial to review the project's setup script and dependencies to identify any potential conflicts or issues. Additionally, checking for any reported issues or updates related to your project's dependencies on GitHub or npm may provide further insights into resolving the problem.

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

3 participants