Connect a nearby dependency to your project if it has the same name as an npm repository

What is the best way to npm link a local dependency that has the same name as a project in the npm registry, like

https://registry.npmjs.org/react-financial-charts
?

Here is an example:

cd ~/projects/react-financial-charts  // Step 1: Navigate to the package directory
npm link                       // Step 2: Create a global link
cd ~/projects/your-project     // Step 3: Move to another package directory
npm link react-financial-charts       // Step 4: Link-install the package

I have noticed that step 4 above links to the official repository instead of my local project with the same name.

Is there a solution to this naming conflict? I want step 4 to link to my local repository, not the package in the npm registry with the same name.

Answer №1

After navigating to the

../react_financial_charts/packages
directory using the command line, I noticed that it contained multiple subfolders. To ensure all packages were linked properly, I manually ran npm link in each subfolder. Once this was completed, I returned to the your-project directory and efficiently linked them all with a single line of code:

npm link @react-financial-charts/series @react-financial-charts/.......

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

Issues with Mocha's beforeEach() and done() functions not functioning as expected

I am facing an issue with my Mocha test suite. When I run the 'make test' command, I encounter the following error message: Uncaught TypeError: Object [object Object],[object Object] has no method 'done' Below is the relevant code sni ...

The click event listener declared with v-on inside a Vue Component fails to trigger

I am currently working on a Vue instance for a sidebar within my application that displays a list of menu items. In order to achieve this, I have created a local component with the following template structure: template:'<div><li class="cust ...

Transforming an array of flat data into a hierarchical tree structure

I'm facing a challenge with my script. I have an Array of FlatObj and some rules, and I need to create a converter function that transforms them into TreeObj. The Rules are: If an object has a higher depth, it should be a child of an object with a l ...

Show only the image source (img src) and do not display the audio and video sources using jQuery

In my code, I need the following conditions to be met: when an image is posted from the backend, the video and audio sources should automatically hide; when a video is posted, the image and audio sources should hide; and when an audio file is posted, the v ...

Execute JavaScript AJAX Request On Page Load

I am facing an issue with creating an onload event in which an AJAX function needs to be called and passed a value. The challenge lies in the fact that I have both my header and footer split into sections via PHP, therefore I cannot place it on the body ta ...

Improving Visibility in AngularJS

I am new to using Angular and encountering a simple issue. I have a button that, when clicked, should reveal a grid and some hidden filters. The filters are structured like this: <div ng-show="filtroFilial" style="visibility: hidden" class="col-md-2"&g ...

What is the method for adjusting the size of text while rendering on a canvas?

When it comes to scaling text with CSS transform scale, for instance: transform: scale(2, 4); fontSize: 20px // Is including fontSize necessary? I also have the task of displaying the same text on a canvas element. function draw() { const ctx = document ...

An Angular application made up of various Angular modules

Currently, my team and I are brainstorming the most effective way to structure an angular application that will inevitably grow in size. This project involves rewriting a large legacy system that has been a nightmare to maintain. Our key objective is to k ...

Transitioning NodeJS from local development to a live website

After successfully creating a site using NodeJS with one-page HTML/jQuery, everything is functioning properly on localhost. However, I am facing issues when trying to put the site online at www.xxxx.com. I already have a registered .com domain, but I am un ...

Why isn't my AJAX POST request to PHP functioning correctly?

It was all working perfectly fine earlier, but now something seems off and I must have made a mistake somewhere. I'm in the process of setting up a form where the information entered is sent via AJAX to my PHP file, which then outputs the username an ...

Saving game data from local storage to populate the player leaderboard

I have successfully developed a game in which users can play and their scores are stored locally. However, I am facing a challenge in figuring out how to showcase the scores of all users in a table on the Rankings page. Player Ranking Page <?php inclu ...

Nested AJAX call yields undefined value

In my Test.vue component, I have a method that is imported into my main.js. I can call its methods like this: this.$refs.test.testMethod(). There is another method in Test.vue called ajaxMethod(), which is defined as follows: function ajaxMethod(){ t ...

Not suitable for Heroku deployment

I have been attempting to deploy this Nuxt.js application on Heroku in universal mode. Following the necessary steps like "npm run build" and "npm run start" for production mode, everything seemed to be working smoothly. Next, I executed the following co ...

Issues with React's useState hook not updating properly

As a React beginner, I am facing an issue with my input field filtering functionality. The problem arises when the results are filtered and rendered, as it seems to be ignoring the last character of the input value. For instance: If I type in "s", nothing ...

Releasing a collection of declaration files for a library

I have successfully added type support to a library using declaration files (.d.ts) generated from jsdocs. However, when the library is used (for example, by importing foo from 'the-library/foo'), TypeScript throws an error stating "Cannot find m ...

Blending an HTML jQuery toggle

Is there a way to make the current headline fade out while simultaneously fading in a new one when switching to the next div using a jQuery .html switch? Check out the codepen example: https://codepen.io/balke/pen/JpNNve $(window).scroll(function() { ...

Show the chosen item from a dropdown menu using Bootstrap

Here is the HTML code that I am working with: <!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="h ...

Utilizing a nested ajax call to pass a value from the first call to the URL of the second ajax call

I am working on implementing live search functionality, where I need to pass an id value obtained from the first ajax call to the second one. Currently, when I type rapidly into the search field, I am able to retrieve the information. However, if I perfor ...

Retrieve a prepared response from a TypeORM query

I need to retrieve all the courses assigned to a user with a simple query: There are 2 Tables: students & courses return await this.studentsRepository .createQueryBuilder('s') .leftJoinAndSelect('courses', 'c' ...

Tips for activating debugging in Electron Main and Renderer with VSCode while utilizing npm-run-all

Utilizing npm-run-all to execute both npm start and npm electron ., I am seeking guidance on setting up debugging with VSCode. Currently, my settings are as follows, but upon initiating debugging, I only receive: C:\Program Files\nodejs\npm ...