npm-link

npm link only dist folder

我与影子孤独终老i 提交于 2021-02-08 13:24:27
问题 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": "./dist/index.js" But still when I run npm link it links to the parent folder which has node_modules and so on. This is causing problems cause now I have 2 react apps installed. I thought of a way to exclude node_modules but I couldn't even find a

npm link only dist folder

安稳与你 提交于 2021-02-08 13:21:58
问题 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": "./dist/index.js" But still when I run npm link it links to the parent folder which has node_modules and so on. This is causing problems cause now I have 2 react apps installed. I thought of a way to exclude node_modules but I couldn't even find a

Angular 5 Upgrade NullInjectorError: No provider for InjectionToken LocaleId

纵然是瞬间 提交于 2020-05-14 07:44:08
问题 I have an Angular 4 app that I have upgraded to Angular 5 with CLI 1.5.4. I also have a shared library using npm link. After upgrading I had to add this to my tsconfig.app.json to get the CLI building again: "include": [ "./**/*.ts", "../node_modules/my-lib/src/**/*.ts", "../node_modules/my-lib/index.ts", "../node_modules/my-lib/ng2-icad-cf.ts" ], After a successful build, I am presented with the following error when visiting localhost:4200 NullInjectorError: No provider for InjectionToken

Difference between `npm link x` and `npm install /path/to/x`

最后都变了- 提交于 2020-01-22 13:20:26
问题 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, I recently noticed that my original impression was wrong, and they both seem to use symlinks - so is there a difference between the two and what is it? 回答1: An article on Medium by Alex Mills lays it out bare. It says the difference between npm link

React Native: npm link local dependency, unable to resolve module

雨燕双飞 提交于 2019-12-18 10:13:47
问题 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 use npm link : cd my-button npm link cd example npm link my-button In example/node_modules/ I can see my-button symlink, VSCode also can auto complete function in my-button package. But execute example app will show error: Unable to resolve module my-button ... Module does

How do I uninstall a package installed using npm link?

陌路散爱 提交于 2019-12-18 09:54:16
问题 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 ('/usr/local/lib`). This allows you to test the package while still developing it, without having to install it over and over again. Which npm command do I need to run to remove the link again? 回答1: The package can be uninstalled using the same uninstall or rm

React Native: npm link local dependency, unable to resolve module

大城市里の小女人 提交于 2019-11-29 21:24:59
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 use npm link : cd my-button npm link cd example npm link my-button In example/node_modules/ I can see my-button symlink, VSCode also can auto complete function in my-button package. But execute example app will show error: Unable to resolve module my-button ... Module does not exist in the module map or in these directories: ... But the path in the error message is correct.

How do I uninstall a package installed using npm link?

▼魔方 西西 提交于 2019-11-29 18:45:27
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 ('/usr/local/lib`). This allows you to test the package while still developing it, without having to install it over and over again. Which npm command do I need to run to remove the link again? The package can be uninstalled using the same uninstall or rm command that can be used for removing installed packages. The only thing to keep in mind is that the link needs