question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Ignore Optional Dependencies

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
zodvikcommented, Mar 14, 2018

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

1reaction
zodvikcommented, 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/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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Option to ignore optional dependencies · Discussion #4960
Currently, the only way I found to not install optional deps was to force installing only production deps with NPM_ONLY_PRODUCTION and then, during...
Read more >
Optional dependency groups omitting package requirements
To be clear: packages listed under omit wouldn't be uninstalled, and having them installed (e.g. manually, or as a dependency of another package) ......
Read more >
Dependencies Management in Setuptools
There are three types of dependency styles offered by setuptools: 1) build system requirement, 2) required dependency and 3) optional dependency.
Read more >
Maven – Optional Dependencies and Dependency Exclusions
The idea is that some of the dependencies are only used for certain features in the project and will not be needed if...
Read more >
Specifying Dependencies - The Cargo Book
The package key, if not specified, defaults to the name of the dependency being requested. Note that if you have an optional dependency...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found