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.

Do not install developer dependencies for NodeJS

See original GitHub issue

search tried in the issue tracker

dev node

describe your issue

The NodeJS language install command uses --dev (which should be --include=dev, #1983) to install packages. This is unneeded.

Packages only require the production (dependencies) installed. Any package that is requiring the developer dependencies to be installed to operate is broken.

If a package is using peerDependencies then additional_dependencies should be used to install them.

This is an issue when installing NPM modules when the developer dependencies are of significant size. The pre-commit users have to sit through a lengthy download session when warming up the pre-commit cache. The downloaded dependencies are unused once installed.

pre-commit --version

pre-commit 2.17.0

.pre-commit-config.yaml

# any config that installs NPM modules

~/.cache/pre-commit/pre-commit.log (if present)

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
asottilecommented, Aug 15, 2022

no it shouldn’t be configurable – though deleting ./node_modules after install should be safe if you’d want to pursue that instead

0reactions
asottilecommented, Aug 15, 2022

but you’ll need to do some research to make sure that’s safe as well

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do you prevent install of "devDependencies" NPM ...
The npm install command will install the devDependencies along other dependencies when run inside a package directory, in a development environment (the ...
Read more >
Adding dependencies to a package.json file - npm Docs
To add dependencies and devDependencies to a package.json file from the command line, you can install them in the root directory of your...
Read more >
Installing Dev Dependencies with npm: Beginners' Guide
NPM installs devDependencies within the package.json file. The 'npm install' command should add all the dependencies and devDependencies ...
Read more >
Error npm install won t install devDependencies - Edureka
For some reason when I run npm install it won't install devDependencies. If I run npm install --dev devDependencies are installed.
Read more >
Include (or omit) Node.js devDependencies in your CI ...
Adding --only=prod or --production would not install devDependencies and just install dependencies . I'll update the article to show both ...
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