It'd be good to be able to --save a package when installing as a link.
Right now, this is sort of possible with npm install --link --save, but only if the package in question is already linked or installed globally.
npm install --link --save
Pick your reaction
@isaacs 2 years without any news. Sup?
Still not implemented, patch still welcome.
It's ok for feature requests to stay open forever. It'll be here when someone gets bored and decides to implement it.
If the package is not already linked or installed globally how would this need to behave? Install it globally?
Point to the relative path specified and link it, that's my preference.
bump; "Point to the relative path specified and link it, that's my preference."
this feature would be awesome and same goes for --save-dev
Banging on this so simple feature again.
I would keep the argument as it was given, If it's a global package, link will remain global as well. This allows packages to be portable. If packaged is not yet available it will fail which is fine.
I see it's flagged as ready :) cool how to get it ?
👍 definitely! it has been tagged as ready, has this been released @othiym23?
Since my Dropbox is grinding to a halt with close to a million files, I've started linking to global packages. I was blown away that this wasn't implemented. This would be super cool :)
@sonewman ready means that it's ready for someone to start work on it, not that it's ready for release. This is one of those things that would best be supported by somebody who really needs it, because the CLI team is small and our backlog is very large.
@othiym23 ahh sorry my bad. I would like to say I will take a shot, but i have a busy schedule...
My guess is it would need to add to package.json here lib/link.js#L108 before resultPrinter.
Would it be done for all the "save" options?
@sonewman I think the only options it would make sense for are --save and --save-dev. --save-optional and --save-bundle seem fraught to me, although I could be persuaded. The other --save options are doing something semantically distinct (and should probably have different names, but that's neither here nor there).
I see this is closed, but what was the conclusion?
Just tried and still doesn't save :(
@shaneparsons / @reggie That's because it's not closed -- this is probably something that's going to need to come from the community, because the core team still doesn't have the cycles for something like this to bubble to the top of the priority list.
Any estimate on how much work it would be to implement this, with no prior familiarity with the npm codebase? I'd like to have this feature as well, and if it wouldn't take too long to implement, I might try my hand at it some day soon.
I created modue-assign a different approach on module linking. It creates a package.json file inside node_modules with a main that references a specified file. In this way it doesn't use linking or symbolic linking. Everything gets saved to a localDependencies property in package.json. I'd appreciate any thoughts.
So, after four years it's unreal?
@reggi - it's awesome, but it would great to use it with npm, like
npm link --save-dev
yes it will be awesome and also smart because every time you don't have to reinstall locally what you already have saved globally (es: grunt)
npm link grunt --save-dev
This is a reasonably small task, and also feels like the intuitively correct thing for the CLI to do in this case; we've created a new milestone to group together this and some of the other tasks related to working with linked packages. We should get to these sometime in 2016, but if you feel like taking a whack at them sooner, by all means, be our guest. Thanks for your patience, and thanks to @isaacs for capturing this idea in the first place.