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

Feature Request: Ignore Optional Dependencies #47

Open
edm00se opened this issue Dec 17, 2017 · 8 comments
Open

Feature Request: Ignore Optional Dependencies #47

edm00se opened this issue Dec 17, 2017 · 8 comments

Comments

@edm00se
Copy link

edm00se commented Dec 17, 2017

It would be nice to have an option to ignore optionalDependencies, which apparently are included with the invoked npm install --production that gets triggered.

@siddharthkp
Copy link
Owner

Make sense, would you like to create a PR?

@edm00se
Copy link
Author

edm00se commented Dec 17, 2017

I'll put it on my list of "when I have time", but it might be a little while 🤔. I'll see when I can look into it. If I make some progress, I'll update here, but if somebody beats me to it, I'd love to see it implemented.

@zodvik
Copy link

zodvik commented Mar 13, 2018

@edm00se If you haven't started working on this, I'll take a shot on this today.

@siddharthkp
Copy link
Owner

Go for it!

@siddharthkp
Copy link
Owner

Also, oh damn! Hi Bafna!

@zodvik
Copy link

zodvik commented Mar 13, 2018

This was a rabbit hole that led to npm/npm#17633. The --no-optional isn't actually working in npm for some time now. I see 2 options

  1. Invoke as --no-shrinkwrap --no-optional as an fix to npm install --no-optional installs optional dependencies anyway npm/npm#17633
  2. Parse package.json file to read optionalDependencies

I would prefer 1. if you don't anticipate side-effect of --no-shrinkwrap for this module usage. Your take?

aside: Hey! Last JS dev I did was in jQuery era, so am rusty :-)

@edm00se
Copy link
Author

edm00se commented Mar 13, 2018

I don't expect the --no-shrinkwrap option should be an issue for the use case. Option 1 should be a pretty solid way to go.

Good find on that npm issue.

@edm00se edm00se closed this as completed Mar 13, 2018
@edm00se edm00se reopened this Mar 13, 2018
@zodvik
Copy link

zodvik commented Mar 14, 2018

npm ls doesn't support --no-optional. Looking for a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants