Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I backup the ".npm" and ".node-gyp" folder?

I am working on a backup plan for my hard-drive, and I would like to know whether there is any need to backup the hidden folders "~/.npm" and "~/.node-gyp"? Or they are just temporary folders whose content is built automatically?

like image 342
Erel Segal-Halevi Avatar asked Nov 15 '13 08:11

Erel Segal-Halevi


Video Answer


1 Answers

The ~/.npm folder is a cache folder that contains local packages so that you don't have to download them over and over when you install them in a new project. You can safely delete this folder and you can in fact do it using the npm cache command:

$ npm cache clean

The ~/.node-gyp folder is the devDir of node-gyp (see relevant source code). This is where development header files are copied in order to perform the compilation of native modules. you can safely delete this directory, as it will be re-created the next time you'll install a module that needs node-gyp.

like image 107
Paul Mougel Avatar answered Oct 15 '22 03:10

Paul Mougel