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

前端 未结 30 2843
清歌不尽
清歌不尽 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:32

    This feature has been introduced in npm v5. update to npm using npm install -g npm@latest and

    to update package.json

    1. delete /node_modules and package-lock.json (if you have any)

    2. run npm update. this will update the dependencies package.json to the latest, based on semver.

    to update to very latest version. you can go with npm-check-updates

提交回复
热议问题