Executing a worldwide npm executable when the shell contains a program with an identical name

After successfully installing npm-check-updates on my Ubuntu 18.04 system using the command npm install -g npm-check-updates, I encountered an issue. You see, when I attempt to run this package with $ ncu, instead of executing the npm utility, the shell triggers a different program that also responds to the same ncu command.

So, my question is: Is there a way to specify that I want to specifically run the npm executable and not the binary located at /usr/local/bin/ncu? Any guidance on this matter would be greatly appreciated.

Answer №1

Use the command whereis to locate the binary images.

⇒  whereis ncu
ncu: /usr/bin/ncu /usr/local/bin/ncu

For instance, on my system, there are two instances of ncu found at /usr/bin/ncu and /usr/local/bin/ncu.

You can then execute it by specifying its full path:

⇒  /usr/bin/ncu      
No package.json
...

To make things more convenient, consider creating an alias for it in your ~/.bashrc or ~/.zshrc file like this:

alias ncu2="/usr/bin/ncu"

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Scroll horizontally based on mouse movement

My angular directive that enables me to choose the content of table cells is performing as expected. However, I encountered an issue when attempting to select multiple cells at once - the scrollbar does not move, hindering my ability to select the cells. ...

Updating the state of a disabled field in a React component

I have been trying to display a default value and disable the field. The values are successfully displayed but the state is not getting updated. Can someone please guide me on how to update the state of a disabled field? I have put in a lot of effort but h ...

By default, the function is triggered automatically upon clicking the button

I am encountering an issue with the code provided below. The testFunction is being executed automatically when the button click event occurs (default behavior of the CMS I'm using). However, I would like to override this behavior and prevent the testF ...

Transform an array containing objects into a single object

Currently exploring the Mapael Jquery plugin, which requires an object to draw map elements. In my PHP code, I am returning a JSON-encoded array of objects: [ { "Aveiro": { "latitude": 40.6443, "longitude": -8.6455, ...

Executing npm script within maven to trigger rimraf, copyfiles, and webpack actions

Within my package.json, I have the following script: "clean": "rimraf dist/*" "copy": "copyfiles -f ./src/index.html ./src/favicon.ico ./dist" "dist": "npm run copy & webpack --env=dist" I am looking to configure Maven build in Jenkins to run the dis ...

Exploring the contrast between 'completed' and 'upcoming' in callback functions within node.js

Within the passport documentation for authentication configuration, there is a function that appears rather intimidating as it utilizes the enigmatic function "done." passport.use(new LocalStrategy( function(username, password, done) { User.findOne( ...

Create an array of objects in JavaScript using JSON data

I have fetched a collection of dictionaries from my API: The data can be retrieved in JSON format like this: [{"2020-03-11 14:00:00":10.765736766809729} ,{"2020-03-11 15:00:00":10.788090128755387}, {"2020-03-11 16:00:00":10.70594897472582}, {"2020-03-11 1 ...

The Group Hover feature in Tailwind CSS seems to only affect the initial SVG element and not any subsequent SVG children within the group

I encountered an issue with TailwindCSS (version 3.2.4) regarding group-hover, where hovering over elements with SVG child elements only seems to affect the first element and not the others. For a demonstration, I have set up an example on the TailwindCSS ...

Steps to create a customized on-click effect for the search button

I have created the following: https://i.sstatic.net/Eu9kh.png And I am aiming for this: https://i.sstatic.net/maKCM.png Both search bars have on-click states but I am struggling to achieve this using bootstrap, CSS, JS. Can someone guide me on how to ...

Guide to hosting AngularJS Material documentation on a local server

After gathering the latest angularjs material, I noticed that the links in the document lead to absolute URLs at material.angularjs.org/.... I wish to have access to read the documentation and demonstration content locally. ...

What is the best way to split a text box into sections, making sure that each section can only contain a single

My task is to develop a registration form One of the requirements is to design a textbox that can be divided into multiple sections, each allowing only one character input as shown in the image. I am unsure how to accomplish this division while still bei ...

Understanding the implementation of setters in JavaScript: How are they utilized in Angular controllers?

After learning about getters and setters, I came across an example that clarified things for me: var person = { firstName: 'Jimmy', lastName: 'Smith' }; Object.defineProperty(person, 'fullName', { get: function() ...

Modifying the height of the bar in Google Charts Timeline using react-google-charts

I am currently working on a Google Chart timeline using react-google-charts. <Chart chartType="Timeline" data={data} width="100%" options={{ allowHtml: true bar: { groupWidth: 10 }, }} ...

javascript code not functioning properly

Something simple! In my asp.net-MVC project, I have a button and an external JavaScript file called mydata.js. This file contains a function called checkJS(). function checkJs() { debugger; alert("your output!!!"); } Here is my code: <div id="m ...

An error occurred during the AJAX request: unexpected token *

I encountered an issue with my ajax script where it returns an unexpected token *. The ajax code I am using is different from the usual example found on w3school.com. Here is a snippet of my script: <script> $("#conform").click(function () { va ...

location on an item within THREE.JS

After successfully loading an .obj file, I am looking to anchor a point on the brain within the image. This point should remain stationary regardless of camera movement, always staying in the same position as depicted in the image below: https://i.sstatic ...

Seeking guidance with NPM dependencies

After encountering an error during an npm audit, I received the following information: Severity: high Inefficient Regular Expression Complexity in nth-check - https://github.com/advisories/GHSA-rp65-9cf3-cjxr A fix is available via running `npm audit fix - ...

When the page is resized for mobile, the Bootstrap modal shifts downwards

I am encountering an issue with a modal that pops up on my webpage when clicked. It is perfectly centered in a browser view and smaller views. However, when I resize the page for phones, the modal shifts down the page and requires scrolling to see it. How ...

Detecting browser reload in React/Typescript: A guide

Is there a way to determine if the browser has been reloaded? I've explored various solutions, but most suggest using code like this: const typeOfNavigation = (performance.getEntriesByType("navigation")[0] as PerformanceNavigationTiming).type ...

The difference between using an event listener directly in HTML vs. using the add

Looking to customize the behavior of an HTML element using event listeners? There are two ways to accomplish this: <form class="my-form"> <input type="submit"/> </form> <script> document.querySelectorAll(&quo ...