Fix the version of all react-scripts dependencies
See original GitHub issueIs 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:
- Created 4 years ago
- Reactions:35
- Comments:27 (7 by maintainers)
@known-as-bmf if you delete
package-lock.json
file and thenode_modules
folder and change the version ofreact-scripts
to3.1.2
it should work after anpm install
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