Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip install for particular dep #930

Closed
ORESoftware opened this issue Aug 17, 2018 · 5 comments
Closed

Skip install for particular dep #930

ORESoftware opened this issue Aug 17, 2018 · 5 comments

Comments

@ORESoftware
Copy link

I am looking for this kind of feature with NPM/verdaccio:

https://stackoverflow.com/questions/51888198/skip-install-for-particular-dep

Is there a way to run npm install but skip a particular dependency?

Something like:

npm install --skip=lodash --skip=rxjs

In my case, I have some developer tooling and some dependencies may not actually be in the NPM registry yet, so I want to skip those.

@juanpicado
Copy link
Member

juanpicado commented Aug 17, 2018

@ORESoftware if the clients do not support that. I really doubt verdaccio can deal with that.
https://docs.npmjs.com/cli/install
https://yarnpkg.com/en/docs/cli/add

Anway, the general policy of all those clients is ALL or NOTHING, whether one dep is missing, the whole process fails.

Update: from npm forum.

For the purposes of developer tools, it would help if npm install worked even if packages weren’t already published to the registry. How would it work? I think it would be simple. NPM would use a dummy package if the package wasn’t on the registry.

Simply put this feature behind a flag, and it won’t break anyone:

npm install --allow-missing

or maybe explicit skipping of packages:

npm install --skip=lodash --skip=rxjs

this would save time during the install, if you are planning to symlink local depenendencies to node_modules.
In other words, say you were developing lodash and rxjs locally, and were going to symlink them to node_modules, when you first run npm install you could effectively skip installing lodash and rxjs because you are going to symlink them anyway, to the top-level node_modules folder.

Likewise, for some people, they want to develop packages that haven’t yet been published before, so it would help if npm install didn’t fail for packages that aren’t in the registry yet.

So to be abundantly clear:

--allow-missing

would mean if a package could not be found, a dummy/empty package would be put in it’s place. On the other hand,

--skip=lodash

would mean it would not even attempt to find lodash in the registry, it would just put a dummy package in it’s place.

@ORESoftware
Copy link
Author

Yeah the problem I have, is for development, sometimes I want to run an npm install for a package that hasn't been published to the NPM registry yet...after the install command finishes, then I link the local dependency with npm link, but npm install will always fail as it stands if there is a missing dep (something isn't in the registry).

@juanpicado
Copy link
Member

Then if the package is not published anywhere, I only recommend do not include it in your dependencies or use a git reference instead. I think you should double check your workflow there.

I'll close this due is not related with verdaccio.

@ORESoftware
Copy link
Author

Thanks, I created an idea/feature request in the NPM community forum:

https://npm.community/t/allow-npm-install-to-work-with-missing-dependency/1526

I tagged this issue on there.

@juanpicado juanpicado added topic: npm node package managers question labels Aug 22, 2018
@lock
Copy link

lock bot commented Mar 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the outdated label Mar 10, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants