npm link is a command on npm CLI which symlink's a package folder
Questions tagged [npm-link]
176 questions
252
votes
8 answers
How do I uninstall a package installed using npm link?
When installing a node package using sudo npm link in the package's directory, how can I uninstall the package once I'm done with development?
npm link installs the package as a symbolic link in the system's global package location…

nwinkler
- 52,665
- 21
- 154
- 168
75
votes
13 answers
React Native: npm link local dependency, unable to resolve module
I am developing a button ui package for react native. I try to build an example project to test this button. The directory structure is as follows:
my-button/
package.json
index.js
example/
package.json
index.js
I try to…

Rick Liao
- 968
- 1
- 7
- 11
54
votes
2 answers
Difference between `npm link x` and `npm install /path/to/x`
I thought I understood the difference between
npm link x
and
npm install /local/path/to/x
originally I thought the former created a symlink to x, whereas the latter installed a separate copy of x in your project, instead of symlinking it.
However,…

Alexander Mills
- 90,741
- 139
- 482
- 817
23
votes
3 answers
How to use npm link with a module written using TypeScript for development?
I am building a lib using TypeScript and Webpack.
To develop this library I have created a separate test project (written using JS) and linked the library using npm link .
The problem is that the link leads to the build file and I need…

Denys Kozak
- 487
- 1
- 4
- 13
23
votes
3 answers
Preserve Symlinks in Angular Libraries
I have a problem.
I'm trying to make a Angular 8 Library using ng-cli, but i can't preserve symlinks from my external application using npm link.
I've tried to add this on my angular.json:
"build": {
"builder":…

andersonbalves
- 309
- 1
- 2
- 12
20
votes
2 answers
npm link only dist folder
Is there a way to restrict npm link to create the symlink only to point at ./dist?
I am struggling so far as I want to test my library (react component) locally before publishing.
In my package.json I have included the main (entry point):
"main":…

Ali Elkhateeb
- 3,413
- 4
- 21
- 39
17
votes
2 answers
npm link removes child dependencies
I am trying to do local development of an NPM package and test it in a package which depends on it. I'm using NPM (7.5.3) and specifically npm link for this but running into a problem with the chain of dependencies.
The child package has…

buckaroo1177125
- 1,555
- 11
- 22
16
votes
3 answers
How to get npm to favor local linked dependency over its published install
I've searched through other questions such as this one, but they all seem to be about a local npm link stopping working for another reason than mine. I assume this is a common use-case issue, so if I'm doing something methodically wrong, I'm more…

Sarreph
- 1,986
- 2
- 19
- 41
15
votes
6 answers
Invalid hook call on npm-link library
Issue description:
I'm currently authoring a package called eformless
I've used CRA to create a directory called sandbox, where I linked the package.
I keep getting the following error, when trying to launch the sandbox react app with the linked…

Samuel Hulla
- 6,617
- 7
- 36
- 70
15
votes
6 answers
npm link is not working with angular-cli created projects
I have created a project using angular-cli. There is one AppModule and AppComponent I want to use this AppModule and its components (AppComponent) in other angular apps. So I have created index.ts file and exported the AppModule and AppComponent…

Sunil Garg
- 14,608
- 25
- 132
- 189
14
votes
3 answers
Webpack gives eslint errors while using npm link
I have a multi-package project set up, where I have one JavaScript package that relies on a TypeScript library. Initially I installed Sinopia and was reinstalling the library every time I made changes to it. Then I saw npm link and thought that it…

iHowell
- 2,263
- 1
- 25
- 49
13
votes
7 answers
How to execute 'npm link' directly on install
I have an internal project where I want to link a command to a file with bin. Like expect this package.json:
{
"name": "my-project",
"bin": {
"cli-name": "./bin/my-executable.js"
},
"dependencies": {
"node-red": "^1.0.0"
}
}
When…

eisbehr
- 12,243
- 7
- 38
- 63
12
votes
3 answers
npm link, without linking devDependencies
It appears that when I run npm link, it will install the project globally, and it seems to install devDependencies with it.
Is there a way to run npm link without devDependencies, perhaps with the --only=production flag?

Alexander Mills
- 90,741
- 139
- 482
- 817
10
votes
3 answers
Yarn Link, Changes To Linked Package Not Reflected in Host App
I'm learning about using yarn link to work on a package and have changes reflected in a host app and I either don't get something or somethings not working.
It is all built in angular5..
I have an app MyApp that contains, among others,…

GRowing
- 4,629
- 13
- 52
- 75
9
votes
4 answers
Can't set breakpoints on NPM Link'ed library
I learn React JavaScript and now I have this problem
I Fork the notistack library in GitHub then download my fork with Git Desktop so the project are on Windows 10 here D:/git/notistack.
After following npm-link doc it all work ok I can debug run…

Kid
- 1,869
- 3
- 19
- 48