D
D
dom1n1k2017-06-22 19:09:09
npm
dom1n1k, 2017-06-22 19:09:09

NPM + Gulp or how not to go crazy?

Listen, why is npm or gulp such buggy shit?
It constantly tells me that gulp is not found, try npm install gulp - although it is naturally installed.
Okay, I put it once again - both locally and globally - all packages that are locally installed in node_modules fall off. They have to be placed one by one again!
After that, it will start successfully a couple of times (well, how successful ... it will show some other errors) and again it will say - gulp was not found, try installing it.
Then I just removed node_modules and did npm install --dev. Well, it should, as it were, put everything that is in package.json in dev dependencies. Should, in theory. It put something there, but when you run gulp-tasks, it says I can’t find either that package or another. Putting them back on by hand...
A few runs later... that's right - can't find gulp!
I put gulp - Cannot find module 'browserify' and so on for all modules.
And I have already passed this circle 4-5 times.
I used to deal with Gulp, but this is the first time.
Under Windows, if that.
PS What is curious - in the process of all these manipulations, the size of the node_modules folder randomly jumps between 3 and 60 mb. And I didn't notice any pattern. Either more or less.
PPS The problem is not solved, but localized on NPM. Some nonsense is going on inside the local node_modules folder. Either something is incorrectly overwritten in it, or the devil knows. And Gulp itself is most likely just a symptom - the global gulp is run, the error is thrown when the line tries to connect the local gulp.
const gulp = require('gulp');

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dom1n1k, 2017-08-14
@dom1n1k

Forgot to write the summary of the story. It seems that the reason was in the buggy NPM 5.0 - after updating to 5.3, the problem (seemingly) went away.

I
Ivan Bogachev, 2017-06-22
@sfi0zy

I ran into a similar problem not too long ago. After the update, npm began to periodically lose write permissions to the local node_modules folder, as a result, half of the packages turned out to be uninstalled. It was discovered by accident and for a couple of days it was crutched by launching everything that was possible from the administrator. I never found out the reason, I returned to my Linux and the old version of npm.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question