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.

Avoid repeating `npm install` on each exercise

See original GitHub issue

Some people find it tedious and a waste of time to have to install NodeJS packages everytime they want to solve an exercise (take a look at exercism.io#2972).

In that discussion, we reached to a solution: improve the documentation on /docs/INSTALATION.md to guide users to install all dependencies on <EXERCISM_HOME>/ecmascript and add that folder to the PATH system variable. This way, all mandatory tools to run tests will be available on the path and there will be no need to npm install on each exercise.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
aeamaeacommented, Nov 22, 2020

At 3kg / GB , it’s about 3000kg / TB or 240,000 kilograms (half a million pounds) of carbon contributed to the atmosphere, just by the Javacript track on exercism.

It’s probably peanuts compared to all the Netflix streaming that’s going on, but I’m going to leave it out here anyway.

https://www.emergeinteractive.com/insights/detail/does-irresponsible-web-development-contribute-to-global-warming/

1reaction
aeamaeacommented, Nov 22, 2020

It’s kinda hokey, but I just move the node modules from the completed exercise to the new one before running npm test for the first time. In all honestly, the base module set could just be cached and moved to each exercise as it’s fetched and any deltas would be downloaded by npm anyway. seems to work for me. It’s a huge waste and has an unacceptable environmental footprint as well. by the end of the JS track, each user would’ve download 9.5 gigabytes worth , multiply that with 86000 students (at the time of this writing) and you potentially have about 80 terabytes of node-modules down the wire that didn’t really need to be downloaded. I’ll leave the carbon footprint calculations for those who are interested in such things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm - how to avoid duplicate node module installation for my ...
The answer "here" mentions a way to avoid the duplicate downloads/install of the same package encountered in case of npm install .
Read more >
How To Use Node.js Modules with npm and package.json
The node_modules folder contains every installed dependency for your project. In most cases, you should not commit this folder into your version ...
Read more >
Duplication and Deduping · GitBook
If a secondary dependency is required by 2+ modules, but was not installed as a top-level dependency in the directory hierarchy, it will...
Read more >
prompt keeps popping up asking me… - Apple Developer
I'm getting the same repeated prompt while trying to set up playwright in VSCode. npm ERR! 2 warnings generated. npm ERR! xcode-select: Failed...
Read more >
Common NPM Mistakes Every Developer Should Avoid
Usually, the peerDependencies are used to avoid duplicate installations of the package dependencies. And, it will be annoying if we lock the ...
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