Coder Perfect

A specified package is updated by Node.


I’d like to update Browser-sync without having to update all of my node packages. What is the best way for me to accomplish this? The Browser-sync GUI is not available in my current version of Browser-sync:(

├─┬ browser-sync@1.9.2
│ ├── browser-sync-client@1.0.2

Asked by Samuel

Solution #1

You can usually just npm update (or pnpm update, or yarn upgrade) a module to acquire the most recent non-breaking changes (while still respecting the semver given in your package). json) (— reread the last paragraph.)

npm update browser-sync
pnpm update browser-sync
yarn upgrade browser-sync

Major version upgrades:

In your situation, it appears that you desire the next major release (v2.x.x), which will almost certainly include breaking changes, requiring you to update your software to accommodate them. You can get the newest 2.x.x by doing the following:

npm install browser-sync@2 --save-dev
pnpm add browser-sync@2 --save-dev
yarn add browser-sync@2 --dev

…or the most recent 2.1.x version by doing:

npm install browser-sync@2.1 --save-dev
pnpm add browser-sync@2.1 --save-dev
yarn add browser-sync@2.1 --dev

…or the most recent and greatest by performing the following:

npm install browser-sync@latest --save-dev
pnpm add browser-sync@latest --save-dev
yarn add browser-sync@latest --dev

Answered by Ryan Wheale

Solution #2

To see the current and latest versions of all packages, type npm obsolete.

Then, to install a specific version, use npm I packageName@versionNumber: for example, npm I browser-sync@2.1.0.

Alternatively, you may use npm I packageName@latest to install the most recent version: for example, npm I browser-sync@latest.

Answered by Qui-Gon Jinn

Solution #3

Upgrade to the most recent version of a specific package:

npm update browser-sync

Update a Package By Version:

npm view browser-sync versions (view package version)

npm install browser-sync@2

All packages should be updated to the most recent versions:

npm is no longer supported (this checks the registry to see if any installed packages are currently outdated)

—save/—save-dev npm update (updates and saves dependencies in package.json)

Perform a security audit on each package:

audit npm (submits a description of the dependencies configured in your project to your default registry and asks for a report of known vulnerabilities) Fix for npm audit (fix vulnerabilities)

All packages are updated to the most recent version:

yarn upgrade

Updates a certain package to the most recent version:

yarn upgrade browser-sync

Updates a specific package to the latest version available:

yarn upgrade browser-sync@^2

Updates all dependencies according to the package’s defined ranges. json:

up pnpm (alias of pnpm update)

Updates all dependencies while ignoring the package’s defined ranges. json:

pnpm up –latest

Updates browser-sync on v2 to the most recent version:

pnpm up browser-sync@2

All dependencies in the @babel scope are updated:

pnpm up “@babel/*”

Answered by Stas Sorokin

Post is based on