D
D
dmz92015-12-24 16:40:10
npm
dmz9, 2015-12-24 16:40:10

Project management on bootstrap 4 + npm - how to avoid littering the file system with node-modules folders?

I work as a coder + a bit of programming (cutting the layout into an engine, bitrix / wp for example), i.e. I make websites at the initial level. I recently decided to contact bootstrap, started with version 4 right away, alpha 2.
From the tools I use only phpstorm for a long time. among other things, I liked its versatility. Operating system [email protected]
After another couple of projects, an interesting question appeared -
I start each project with the bootstrap source codes. I want to better understand and remember everything you need to remember, study the developments and optionally enable / disable certain modules, especially with regard to scss.
Doing everything according to the "book" I go to the project folder and just write npm install. Approximately 14k files are uploaded, occupying 160+ megabytes on the disk with the smallest cluster (there was a 64kb cluster - it took a gigabyte)))).
There are more and more projects over time, but how can you prevent a bunch of identical files from growing on disk in different projects?
In short, I don’t know how to make it so that there is one folder with the maximum number of all the necessary modules from devDependencies, which will be used when grunt works in each individual bootstrap project. Everyone will have a local soil, there's nothing to be done, but to multiply the folder with the modules...
Somewhere I slipped advice that you need to set the global variable NODE_PATH pointing to the folder with the global installation of the node - I looked at this variable - I did not find it. Will it help the soil to haul modules from exactly one specific "non-local" folder?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Kravchenko, 2015-12-24
@mydearfriend

I don’t know how the grant is, in the gallp I can pass the current project as an argument and focus on it in the task code. thus, all projects can use one galpfile, which will include tasks depending on the current project

--root
----node_modules
----projects
----gulpfile.js

D
dmz9, 2016-01-14
@dmz9

a small update
about symlinks - entries appeared in the console during npm update from the project folder with a symlink node_modules
something like this

...
npm WARN skippingAction Module is inside a symlinked module: not running move [email protected] node_modules\node-sass\node_modules\readable-stream
npm WARN skippingAction Module is inside a symlinked module: not running add [email protected] node_modules\node-sass\node_modules\request\node_modules\bl
npm WARN skippingAction Module is inside a symlinked module: not running add [email protected] node_modules\node-sass\node_modules\strip-ansi
...
npm WARN skippingAction Module is inside a symlinked module: not running remove [email protected] node_modules\tar-stream\node_modules\readable-stre
am
...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question