question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix the version of all react-scripts dependencies

See original GitHub issue

Is your proposal related to a problem?

Yes. In my team, we always remove package-lock.json (and add a .npmrc file with package-lock=false) due to issues in the past. Also we fixed the version of react-scripts to 3.1.1 Due to this, when running npm install (in CI/CD pipeline for example) we get the specific react-scripts package we have in the package.json but some dependencies can be updated too. Those dependencies may be incompatible with the specific react-scripts and we get errors when we do npm start

For example some hours ago the react-scripts version was 3.1.1 and now is 3.1.2 and now we are getting errors with some eslint rule (some packages related to eslint were updated to new versions but our react-scripts is not)

How to reproduce today: 1- do npx create-react-app test --typescript and wait for the install 2- go to test folder and remove package-lock.json and node_modules folder 3- go to package.json and change react-scripts version from 3.1.2 to 3.1.1 as it was yesterday 4- run npm install and wait 5- run npm start then you will get this error:

Failed to compile.

./src/index.tsx
  Line 1:  Definition for rule '@typescript-eslint/consistent-type-assertions' was not found  @typescript-eslint/consistent-type-assertions

Describe the solution you’d like

Fix the version of all react-scripts dependencies and change them only on new react-scripts releases

Describe alternatives you’ve considered

Update the react-scripts version hoping not to break anything (I have also tried to find out the set of packages that changed and specify in my package.json the desired version, but that has not worked)

Additional context

I would like to have to update the packages only when I want, and not as a result of some dependency of a dependency has been updated and causes errors

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:35
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

19reactions
jjavierdguezascommented, Sep 20, 2019

@known-as-bmf if you delete package-lock.json file and the node_modules folder and change the version of react-scripts to 3.1.2 it should work after a npm install

6reactions
lilycjcommented, Sep 24, 2019

This fix is not working for me. Deleted package-lock.json, deleted node-modules, updated react-scripts to 3.1.2 then on npm install I get:

npm WARN eslint-config-react-app@5.0.2 requires a peer of @typescript-eslint/eslint-plugin@2.x but none is installed. You must install peer dependencies yourself. npm WARN eslint-config-react-app@5.0.2 requires a peer of @typescript-eslint/parser@2.x but none is installed. You must install peer dependencies yourself. npm WARN @typescript-eslint/parser@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @typescript-eslint/eslint-plugin@1.13.0 requires a peer of eslint@^5.0.0 but none is installed. You must install peer dependencies yourself.

I’ve also tried 3.1.1 and 3.1.0 and all are giving me the same issue. Could anyone advise how to fix this? I’ve tried installing the peer dependencies but there’s a very long chain of them.

** I should also say that I do still get the Definition for rule '@typescript-eslint/consistent-type-assertions' was not found @typescript-eslint/consistent-type-assertions error as well

Read more comments on GitHub >

github_iconTop Results From Across the Web

Npm audit fix --force react script downgrade automatically
A possible workaround is to move react-scripts to the devDependencies section in your package.json and use npm audit --production to audit ...
Read more >
react-scripts - npm
Latest version: 5.0.1, last published: 9 months ago. Start using react-scripts in your project by running `npm i react-scripts`.
Read more >
Updating to New Releases - Create React App
To update an existing project to a new version of react-scripts , open the changelog, find the version you're currently on (check package.json ......
Read more >
react-scripts | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
react-scripts - npm Package Health Analysis - Snyk
Ensure you're using the healthiest npm packages. Snyk scans all the packages in your projects for vulnerabilities and provides automated fix advice.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found