This goes right into the series “i should have known that for a while“.
Na. It should go into “How the heck didn’t i see that before“.
I have been wondering for a while, on how to work on a project with Gulp, be able to switch computer and still have the exact same project on the other machine. I already saw that the files in the
node_modules folder couldn’t get tracked by git.
I finally had my “oh snap” moment today as checking on another Gulp based project and especially the package.json file at the root. It had all the devDependencies the project needed to run. So i headed back to my own project to discover that i did not have such a file. After 2 mins of Googling, i found out that a simple npm init at the root of the folder would create such as file and that after doing a few npm install gulp --save-dev and npm install gulp-sass --save-dev among others, it would add those packages right into the package.json file automatically!
I did a final test by copy/pasting this single file into a test folder and running a npm install from there. BAM! All my devDependencies would be downloaded right into the new folder. A quick git clone to grab the project files and the gulpfile.js and my project was ready to run.
Do not know if i made myself very clear but damn, feels good to learn something this important.