Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

Protractor Tutorial 8 – NPM – Updating Global and Local Package

Posted on 02/19/2025 By admin

Hello Folks,

In last post we have seen how can we install NodeJS package locally and globally.

In this post we will learn:-

  1. How to check if a package is outdated?
  2. How to update locally installed package?
  3. How to update globally installed package?

Before checking for the outdated package, let’s install outdated package locally and globally.

We will install outdated version of xlsx NodeJS package. Current version of xlsx is 0.14.3 but we will install 0.13.0:-

You can list global package without depth using npm list -g -depth=0

We will install same xlsx package but different outdated version i.e. 0.14.0:-

You can list locally installed package without its dependent packages using npm list -depth=0

We have a command to check the registry to see if any (or, specific) installed packages are currently outdated. Command is as below:-

npm outdated [[/] …]

Let’s run it at both locally and globally:-

You can see that above commands gives you some details. Let’s see meaning of each field:-

Package: – Installed NodeJS package name.

Current:- The currently installed version of package in your system.

Wanted:- It is the maximum version of the package that satisfies the semver range specified in package.json. If there’s no available semver range (i.e. you’re running npm outdated --global, or the package isn’t included in package.json), then wanted shows the currently-installed version or close-by version.

Latest:- It is the version of the package tagged as latest in the registry.

Location:- It is where in the dependency tree the package is located.

Now understand result of outdated commands above:-

Locally:

We do not have any package.json in local folder. So “Wanted” field is showing “0.14.3” which is close-by version of installed version “0.14.0”.

Globally:-

Like local, when we run outdated command for global package, “Wanted” will also give close-by version. So “Wanted” field is showing “0.13.5” which is close-by version of installed version “0.13.0”.

Read more about outdated command here.

NPM provides a command to update package/s which is below:-

npm update [-g] […]

This command will update all the packages listed to the latest version (specified by the tagconfig), respecting semver. If the -g flag is specified, this command will update globally installed packages. If no package name is specified, all packages in the specified location (global or local) will be updated.

To update a specific package, pass package name with command as:-

npm update

Let’s update all package in global and local:-

Global:-

Package was updated to version mentioned in “Wanted” field.

Local:-

You will also find same behavior as global here:-

When you have latest installed, you will not get any output for npm outdated command.

Anyway above concept will change if package.json exists. We will see those as well in upcoming posts.

You may find it little confusing. Raise questions/doubts/concerns if any.

#ThanksForReading

Uncategorized

Post navigation

Previous Post: TestNG Tutorials 65 : Dry Run Feature in TestNG
Next Post: Validate The Validation You Do – isEnabled() & isSelected() Methods in Selenium WebDriver

Related Posts

Make Selenium Easy – Page 4 Uncategorized
How To Upload Multiple Files In Selenium WebDriver – Java Uncategorized
Make Selenium Easy – Page 9 Uncategorized
PostmanDemo – Make Selenium Easy Uncategorized
image – Make Selenium Easy Uncategorized
Validate The Validation You Do – isEnabled() & isSelected() Methods in Selenium WebDriver – Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark