See the NPM docs and semver docs:
~version
“Approximately equivalent to version”, will update you to all future patch versions, without incrementing the minor version.~1.2.3
will use releases from 1.2.3 to <1.3.0.^version
“Compatible with version”, will update you to all future minor/patch versions, without incrementing the major version.^2.3.4
will use releases from 2.3.4 to <3.0.0.
See Comments below for exceptions, in particular for pre-one versions, such as ^0.2.3
Related Contents:
- What’s the difference between dependencies, devDependencies and peerDependencies in npm package.json file?
- Is there a way to get version from package.json in nodejs code?
- How to set environment variables from within package.json?
- Find unused npm packages in package.json
- npm install private github repositories by dependency in package.json
- How to use private Github repo as npm dependency
- How do I fix a vulnerable npm package in my package-lock.json that isn’t listed in the package.json?
- How to install only “devDependencies” using npm
- npm update does not do anything
- How to specify the path of `package.json` to npm?
- How to use environment variables in package.json
- Change working directory for npm scripts
- Make `npm install –save` add a strict version to package.json
- NPM : how to just run post-install?
- What’s the difference between dependencies, devDependencies, and peerDependencies in NPM package.json file?
- npm package.json OS specific script
- Update package to a major release with NPM
- How to find unused packages in package.json?
- How to set env var for .npmrc use
- What is the correct way of adding `react` as a dependency in the `package.json` of a reusable components library?
- Find the version of an installed npm package
- npm command to uninstall or prune unused packages in Node.js
- Why does npm install say I have unmet dependencies?
- How to completely remove node.js from Windows
- Is there a way to make npm install (the command) to work behind proxy?
- How to list all versions of an npm module?
- What is the bower (and npm) version syntax?
- Node – was compiled against a different Node.js version using NODE_MODULE_VERSION 51
- How do I update devDependencies in NPM?
- npm install errors with Error: ENOENT, chmod
- Node.js Error: Cannot find module express
- What is deduped in npm packages list?
- NPM: npm-cli.js not found when running npm
- How to resolve Node.js: “Error: ENOENT: no such file or directory”
- ‘Unable to Authenticate’ when trying to connect to Azure DevOps Artifacts feed through npm; I get an E401 error
- How to organise file structure of backend and frontend in MERN
- npm install gives error “can’t find a package.json file”
- Npm install gives warnings, npm audit fix not working
- package-lock.json file, package with “optional”: true
- Installing NPM on AWS EC2
- How to get the npm global path prefix
- Cypress verification timed out after 30000 milliseconds
- npm error E401: Unable to authenticate, need: BASIC realm=”Sonatype Nexus Repository Manager”
- Angular 6 many Can’t resolve errors (crypto, fs, http, https, net, path, stream, tls, zlib)
- create-react-app, installation error (“command not found”)
- Can a custom directory name be used instead of ‘node_modules’ when installing node packages?
- Error: EBUSY: resource busy or locked, rmdir
- Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/node-sass/build’
- Cannot uninstall angular-cli
- Is Lerna needed anymore with NPM workspaces?