174 questions
0
votes
0
answers
99
views
Resolving duplicate React implementations when using NPM Link on a React Component Library package
Got a question about how best to symlink a React component library NPM package to a parent/consuming React project.
The component library in question works without issue when build and publishing it ...
-1
votes
1
answer
114
views
Import intellisense for custom package is not working in vs code
Hi i am creating 2 simple test projects where project A is a custom NPM package and project B consume it. The issue is that there is no import intellisense.
My folder structure looks like this:
...
0
votes
0
answers
409
views
Vite Vue Npm link exports{*/dist} How to fix "Failed to resolve"
How to fix "Failed to resolve"?
If you have a Vue3 app that uses local packages imported via npm link with symbolic links, and you encounter the following error:
12:29:14 PM [vite] Pre-...
0
votes
0
answers
623
views
How can I npm link a local package in a monorepo to another application?
So I've been at this for a while, I have a npm workspace with a my packages (a monorepo basically) and I am trying to link a ui library I'm working on (the library is using react) so that I can use it ...
7
votes
5
answers
12k
views
How do I fix npm ERR! gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#<Object>' when running npm link some-dep
I am trying to run npm link felca-runtime and am getting the below error, which I can't find anything useful on online:
theo.hodges@DKH334L0G5 felca-nhsuk % npm link felca-runtime
npm notice Beginning ...
1
vote
1
answer
757
views
npm link command is not working after I installed a package globally but want to run the command in the local project
I installed a package "cowsay" globally using npm i -g cowsay.
I ran the "cowsay" command in the terminal as cowsay helloooo and it ran without any error producing output:
< ...
2
votes
0
answers
774
views
How to use local react library in test project during development of the library
I've looked around a lot in the last few days ... and I was never able to succeed with this
What I'm trying to achieve: I am developing in a (forked) existing react library and I want to "link&...
0
votes
1
answer
92
views
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-...
0
votes
1
answer
421
views
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 ...
0
votes
1
answer
1k
views
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 ...
2
votes
0
answers
104
views
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 ...
2
votes
1
answer
3k
views
Npm link and scoped packages
When running npm link (as per the multiple vague blog posts on the subject) on a private scoped packed, I am getting an E404 error.
This seems particularly odd considering the entire point of npm link ...
2
votes
1
answer
264
views
Development of a custom module with TS in React App
I have 2 projects with common functionality.
I need to develop my own npm module that will use common code snippets for this.
I made a separate project that will contain this shared code (eg util).
At ...
2
votes
1
answer
568
views
"Error: inject() must be called from an injection context" with npm link, Angular and library with peerDependencies
I have an application MyApp and a library MyLib. MyApp consumes MyLib. We package and bundle MyLib on Azure Devops as an Artifact, that can be consumed both on Azure and locally. This all works fine.
...
1
vote
2
answers
726
views
What is the purpose of npm link and how to use it in React JS Projects?
As I am new to React JS and Node JS, I am unable to understand the purpose of npm link and how to use it in React JS Projects even from the npm documentation. It is appreciable to explain the same ...
7
votes
0
answers
699
views
Using npm link with a module utilizing Nuxt3 ends in error
I want to create an npm module with Nuxt 3 components. For that I defined the
"nuxt.js" file the following way.
import { join } from 'path'
import { defineNuxtModule} from '@nuxt/kit'
...
0
votes
1
answer
2k
views
NPM link - Application cannot find linked library's dependencies [ANGULAR]
I am developing an application and a library used in said application. I need to update the library, however, when I use NPM link the application says that the library I have imported does not have ...
3
votes
1
answer
1k
views
Cannot import JSX/TSX component from another React app to my main React app
I have a fairly complex setup regarding two React apps.
Context:
I was tasked to create a design system using ReactJS to be later on used in their main app.
So i did made a design system in 1 week (w/ ...
1
vote
0
answers
142
views
React project does not recognize React local library typings linked by npm link
I developed this React main project (foo-proj) and a React design library (foo-lib). In order to improve local development I used "npm link" to use foo-lib inside foo-proj.
- foo-proj
- ......
4
votes
0
answers
668
views
How to configure typescript in a project with linked local package
I am working on a project that is linked to some other local project like this:
{
"name": "lib-a",
dependencies: {
"lib-b": "file:../../lib-b"
}
}
...
0
votes
0
answers
294
views
MUI v5 theme not working, except with link
I'm working on a library with MUI v5. The problem is I'm importing this library to a React project (React v17.0.1) which uses MUI v4.
The problem is that the MUI theme is not working on my components, ...
2
votes
0
answers
2k
views
How to put together TypeScript, Vite, React and npm link?
I wrote a simple embryonic TypeScript package (published on a private registry) and I want to import it in a TypeScript React app created with Vite.
Everything works fine until I try npm link the two ...
1
vote
0
answers
361
views
How do I dynamically link a local created npm package to another project?
I have a project that exports a package to be used by other projects (some infra code).
I've published it in a local repo, and then installed it on my main project.
I need to keep working on that ...
2
votes
0
answers
275
views
Exporting types and enums fails when using yarn/npm link
I'm trying to link a library between two projects to help with development workflow.
Sharing some code and types between my TypeScript backend and frontend.
It seemed to work with const functions, but ...
1
vote
0
answers
143
views
How to decouple npm package and replace the codebase with unpackaged direct version of the source code?
I am trying to understand the codebase of Pancakeswap frontend, the current structure https://github.com/pancakeswap/pancake-frontend has a dependency on
@pancakeswap/sdk and @pancakeswap/uikit
Which ...