Questions tagged [npm-link]

npm link is a command on npm CLI which symlink's a package folder

Reference:

176 questions
0
votes
1 answer

Can't import from linked npm library

I have an NPM library called 'example-lib' (built with Rollup) and a Vite React-TS project. I want to test 'example-lib' in my Vite project using npm link. in library: npm link in project: npm link @mjana/example-lib However, I'm encountering an…
Michal
  • 803
  • 2
  • 9
  • 26
0
votes
1 answer

ng build --watch deletes the project directory inside dist

I have two libraries for my app: contact-us and about-us. Contact-us is perfectly linked to my app, but when I use the same approach to link about-us, I get some errors!. What I've done to link about-us: cd libraries/about-us/ npm run build cd…
user6781
  • 25
  • 4
0
votes
1 answer

How to use npm link?

I have a module, let call it contact_us, that I have linked it to my ionic project. I could successfully link the module and see it in my app, but when I modify the contact_us module, the changes are not reflected in my project. Here is what I've…
user6781
  • 25
  • 4
0
votes
1 answer

How to link a module in an app by npm link

I have a library, let's call it my_library, that I need to link it to my app. So what I've done so far is: 1. In my_library directory: #install dependencies npm install cd projects/my_library npm install projects/my_library/node_modules is…
user6781
  • 25
  • 4
0
votes
0 answers

how to use npm link in Dockerfile for multiple inter-dependant node applications

We have 3 node applications A, B, C. A is standalone application, doesn't depends on services. B depends on A and C depends on both A and B So architecture is like A/ ... node_modules/ B/ ... node_modules/ ... A/ …
Radhe9254
  • 198
  • 1
  • 11
0
votes
0 answers

How to reference a local package in a project that is running in Docker container?

I want to simultaneously work on two projects: Project A Project B (a package used in Project A) I am developing project A in a docker container. Is there a way I can use the local version of Project B inside of Project A? I want to be able to…
0
votes
0 answers

Storybook fails to load story with npm link: "react is not defined" (using React 18)

I'm building a UI component library using React 18 and exporting a Button.tsx component in it. Then, to test that I can use that Button component, i'm importing it into a different component, Test.tsx, within that same UI component library code…
Gambit2007
  • 3,260
  • 13
  • 46
  • 86
0
votes
0 answers

Visual Studio does not bundle SVGs when using npm link and a local version of my NPM package, but using the published cloud version is fine?

I have a MFE that is published as an npm package. The mfe is rendered inside a webview. I use Visusal studio to build local versions of the iOS app. When using regular npm install, the svg's get bundled and are fine, but when i use npm link to test…
atunamelt
  • 1
  • 2
0
votes
1 answer

Angular is unable to resolve module path of a custom NPM package

I'm developing an Angular 13 custom library using NPM V8.19.3, and it makes use of Dynamsoft WebTwain v18.1.0 library to manage a scanner. It should be later consumed locally - e.g. via NPM link - by an Angular application in the same workspace for…
0
votes
0 answers

nconf returns undefined if dependency linked with npm link

I have two projects. Let's say: Project A, Project B Project B is a dependent module in Project A When we do npm start i.e. start the server for Project A, the nconf gets initialized with development env files succesfully and returns all the related…
Vishal Singh
  • 349
  • 3
  • 8
0
votes
0 answers

Compilation error after npm link. (react, typescript, webpack)

I'm trying to link a local library into bigger react project but without any success. In dist folder of library I do npm link. In the bigger project I do npm link @myScope/myLibrary and it looks like it installed correctly. But when I try to build…
Dalton
  • 347
  • 3
  • 15
0
votes
0 answers

failed to install liba. npm Link

I'm trying to use npm link in my project App, I also have two libraries liba and libb. my App uses both liba and libb and my libb uses liba Ihese are the commands I followed: npm link inside liba npm link inside libb npm link liba inside libb npm…
0
votes
1 answer

Using a packaged linked via npm link in create-react-app leads to webpack error: module has no exports

I am developing a React hook locally, and trying to test it in an adjacent create-react-app project (under folder example/). However, importing said linked module results in the following errors: Attempted import error: 'usePleaseStay' is not…
fullStackChris
  • 1,300
  • 1
  • 12
  • 24
0
votes
0 answers

Does the npm link fix for multiple React instances just not work with newer versions of npm?

So, I have an npm package that requires React that I'm wanting to test locally by using npm link to import it into its consumer React app. The typical way (and in fact the way proposed in the React docs) to avoid getting an Invalid hook call error…
RobSka17
  • 41
  • 3
0
votes
0 answers

Can npm link be used to change one project and then import this local version to another project that uses version from git?

I have two projects, Basic, and Concrete. Concrete imports Basic from Git in package.json, package-lock.json. Right now I'm making some changes to Concrete, and it uses API that comes from Basic. My problem is that currently one of the API functions…