`yarn upgrade` does not update package.json | SOLUTION

Ilya Zykin
1 min readApr 18, 2019

--

I had to update some NPM packages. In our team we use https://depfu.com which informs us about outdated packages.

I wanted to update some packages manually and I found that it’s not so easy.

The command:

yarn upgrade react react-dom jest-dom css-loader 

Just updated yarn.lock but didn’t update package.json

I went to official docs: https://yarnpkg.com/lang/en/docs/cli/upgrade

and didn’t find any option to reach my goal

I went to the ticket https://github.com/yarnpkg/yarn/issues/2042

and didn’t find a way to reach my goal again.

Finally I tried

yarn upgrade react react-dom jest-dom css-loaderyarn add react react-dom jest-dom css-loader

In this case first command updates yarn.lock and the second one package.json

Enjoy with development!

--

--

Ilya Zykin
Ilya Zykin

Written by Ilya Zykin

IT coach. React and Rails enthusiast. Passionate programmer, caring husband and pancake baker on Sundays. School teacher of computer studies in the past.

Responses (4)