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

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

    1. Use * as the version for the latest releases, including unstable
    2. Use latest as version definition for the latest stable version
    3. Modify the package.json with exactly the latest stable version number using LatestStablePackages

    Here is an example:

    "dependencies": {
            "express": "latest"  // using the latest STABLE version
        ,   "node-gyp": "latest"    
        ,   "jade": "latest"
        ,   "mongoose": "*" // using the newest version, may involve the unstable releases
        ,   "cookie-parser": "latest"
        ,   "express-session": "latest"
        ,   "body-parser": "latest"
        ,   "nodemailer":"latest"
        ,   "validator": "latest"
        ,   "bcrypt": "latest"
        ,   "formidable": "latest"
        ,   "path": "latest"
        ,   "fs-extra": "latest"
        ,   "moment": "latest"
        ,   "express-device": "latest"
    },
    

提交回复
热议问题