npm folder disappears when installing gulp


(None) #1

Versions referenced:
Windows v8.1
node v8.11.3
npm v5.6.0
gulp cli v2.0.1
gulp local 3.9.1

I’m taking a class on gulp and tasked myself with installing it at home. In class we first installed npm alongside node and then ran the commands:

npm init
npm install --saved-dev gulp
npm install -g gulp

I’ve tried a number of variations on this but the result is always the same - at some point in the process the npm folder is removed from my node_modules directory and I can no longer run npm.

I currently have gulp running but was wondering why the npm folder is being removed, after which I obviously can no longer use it. I’ve also tried:

npm install --global gulp-cli 
npm init 
npm install --save-dev gulp

This installed gulp great! But now the npm folder is removed and whenever I try to run npm I get the error:

Error: Cannot find module 'C:\Apache24\htdocs\node\node_modules\npm\bin\npm-cli.
js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
module.js:549
    throw err;
    ^

Error: Cannot find module 'C:\Apache24\htdocs\node\node_modules\npm\bin\npm-cli.
js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3

I can copy the npm folder from the npm archive and paste it back into the “node_modules” folder, but I’d like to understand why it’s happening! It would also be nice to understand in what way to install gulp without removing the folder in the first place.


(system) #2

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.