Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Moving an NPM (Gulp) installation to another folder

Tags:

node.js

npm

gulp

I just set up a new project using NPM, like normal:

npm init
npm install gulp --save-dev
npm install gulp-sass gulp-clean-css gulp-autoprefixer gulp-sourcemaps gulp-uglify gulp-concat --save-dev

etc.

But then I realized, like a numpty, I'd installed it in the directory above the one I intended.

I've looked through the documentation and can't see any clear indication if there's some central repository on my system that will become upset if I start manually moving things around.

Can I just move the files I created (package.json, node_modules/*) to the right folder, or do I need to "un-init"/remove NPM from the folder and start over? (If so, how do I do this?)

Thanks.

like image 571
Chuck Le Butt Avatar asked Nov 17 '25 08:11

Chuck Le Butt


1 Answers

Move the package.json to the right directory and delete the NPM stuff from the subfolder, then execute:

npm install

Because you used

--save-dev

before, the names of the packages installed are in your package.json file and used during the (second) installation.

like image 113
RhinoDevel Avatar answered Nov 19 '25 21:11

RhinoDevel