I was trying to use npm link to link to components and code which we use in different JS projects. Both the projects, and the shared components and packages are in the same Git repository. Using 'npm link' allowed me to access such a package from a project, but added nothing to the package.json of the project. Which means that even if all the packages and pojects are in the same repository, since it is not recorded in the package.json it will break the project for other members in the team. I tried adding "-save" to the command in the project directory ("npm link -save" but it had no effect. Is there a way to make 'npm link' work for teams?
Asked
Active
Viewed 96 times
0
-
`npm link` sets up symbolic links, local by definition. – Dave Newton Jun 19 '18 at 15:48
-
I don't think it's possible. In our team, we work around it by publishing beta versions of packages that are work-in-progress – Patrick Hund Jun 19 '18 at 15:51
-
@PatrickHund, what do u mean by "publishing"? publish as an NPM private module? – Ben Carp Jun 20 '18 at 00:07
-
Yes, for example, if the npm package you're linking is private. If you tag a publish with beta or some other tag, you have to set the dependency explicitly – Patrick Hund Jun 20 '18 at 06:23