How to update each dependency in package.json to the latest version?

前端 未结 30 3409
清歌不尽
清歌不尽 2020-11-22 08:01

I copied package.json from another project and now want to bump all of the dependencies to their latest versions since this is a fresh project and I don\'t mind

30条回答
  •  旧巷少年郎
    2020-11-22 08:13

    As of npm version 5.2.0, there is a way to run this in a single line without installing any additional packages to your global npm registry nor locally to your application. This can be done by leveraging the new npx utility that's bundled with npm. (Click here to learn more.)

    Run the following command in the root of your project:

    npx npm-check-updates -u && npm i
    

提交回复
热议问题