0

Hi I'm wondering if there is a way to overwrite where my project reads a package from.

I am currently working on an component library for use in a couple of projects that are using an older version of it.

-/Dist
--MyNodePackage@3.0
-/TestApp
--/node_modules
---MyNodePackage@2.0
--ReactApp.js
-/TestApp2
-/TeastApp3
...etc

Without going into all the files in the projects that use the older version of the package and replacing the import every time I make a pull request to the app, is there a way to overwrite where its pointing to?

e.g.

import {NodePackage} from "MyNodePackage";//This is the current way of importing in every file
import {NodePackage} from "../Dist/MyNodePackage";//What I don't want to have to do
Ferran Buireu
  • 24,410
  • 6
  • 32
  • 55
HichiHachi
  • 431
  • 1
  • 6
  • 16
  • You update the dependency in `package.json` (see [here](https://stackoverflow.com/questions/14381898/local-dependency-in-package-json)) and then run `npm install`. – Mike 'Pomax' Kamermans Aug 01 '21 at 15:08

0 Answers0