Error cannot find module gulp util

On Windows 7, I've installed gulp as explained here: http://markgoodyear.com/2014/01/getting-started-with-gulp/: npm install gulp -g In my app folder: npm install gulp --save-dev I create a gulpfi...

Linux Ubuntu 18:04 user here.
I tried all the solutions on this board to date. Even though I read above in the accepted answer that «From later versions, there is no need to manually install gulp-util.», it was the thing that worked for me. (…maybe bc I’m on Ubuntu? I don’t know. )

To recap, I kept getting the «cannot find module ‘gulp-util’» error when just checking to see if gulp was installed by running:

gulp --version

…again, the ‘gulp-util’ error kept appearing…

So, I followed the npm install [package name] advice listed above, but ended up getting several other packages that needed to be installed as well. And one had a issue of already existing, and i wasn’t sure how to replace it. …I will put all the packages/install commands that I had to use here, just as reference in case someone else experiences this problem:

sudo npm install -g gulp-util

(then I got an error for ‘pretty-hrtime’ so I added that, and then the others as Error: Cannot find module ___ kept popping up after each gulp —version check. …so I just kept installing each one.)

sudo npm install -g pretty-hrtime
sudo npm install -g chalk
sudo npm install -g semver --force

(without —force, on my system I got an error: «EEXIST: file already exists, symlink». —force is not recommended, but idk any other way. )

sudo npm install -g archy
sudo npm install -g liftoff
sudo npm install -g tildify
sudo npm install -g interpret
sudo npm install -g v8flags
sudo npm install -g minimist

And now gulp —version is finally showing:
CLI version 3.9.1
Local version 3.9.1

Posted By: Anonymous

On Windows 7, I’ve installed gulp as explained here: http://markgoodyear.com/2014/01/getting-started-with-gulp/:

  • npm install gulp -g
  • In my app folder: npm install gulp --save-dev
  • I create a gulpfile.js file.

But then, when I try to run gulp, I get this error message:

module.js:340
throw err;
      ^
Error: cannot file module 'gulp-util'
at Function.Module._resolveFilename (module.js:338:15)

etc.

But gulp-util is present (in the local app folder) in:

node_modules
    gulp
        node_modules
            gulp-util

Any idea what may be the cause?

Solution

UPDATE

From later versions, there is no need to manually install gulp-util.

Check the new getting started page.

If you still hit this problem try reinstalling your project’s local packages:

rm -rf node_modules/
npm install

OUTDATED ANSWER

You also need to install gulp-util:

 npm install gulp-util --save-dev

From gulp docs- getting started (3.5):

Install gulp and gulp-util in your project devDependencies

Answered By: Anonymous

Related Articles

  • npm install error in vue
  • How to add Typescript to a Nativescript-Vue project?
  • using d3.js with aurelia framework
  • NodeJS — Error installing with NPM
  • Running Python on Windows for Node.js dependencies
  • Aurelia Typescript skeleton -navigation error with npm start…
  • Ubuntu apt-get unable to fetch packages
  • Webpack dev server for vue-cli: Error spawn EACCES
  • Can’t correctly import external JS into Aurelia application…
  • Laravel — npm run watch does not work on Lara 7, Node:…

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

okay i’ve been spending over a day to solve this gulp issue, i literally tried everything by run npm install after deleting node_modules or anything i find, but when i tried to run gulp or anything related to gulp command it always throw an error like this

internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module 'gulp-util'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/usr/lib/nodejs/gulp/bin/gulp.js:4:13)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)

can someone help me?
so far i’ve tried some of this solutions:

Can’t get Gulp to run: cannot find module ‘gulp-util’

Cannot find module ‘gulp-util’

Issues with ionic: Error: Cannot find module ‘gulp-util’

and many more

okay i’ve been spending over a day to solve this gulp issue, i literally tried everything by run npm install after deleting node_modules or anything i find, but when i tried to run gulp or anything related to gulp command it always throw an error like this

internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module 'gulp-util'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/usr/lib/nodejs/gulp/bin/gulp.js:4:13)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)

can someone help me?
so far i’ve tried some of this solutions:

Can’t get Gulp to run: cannot find module ‘gulp-util’

Cannot find module ‘gulp-util’

Issues with ionic: Error: Cannot find module ‘gulp-util’

and many more

1

okay i’ve been spending over a day to solve this gulp issue, i literally tried everything by run npm install after deleting node_modules or anything i find, but when i tried to run gulp or anything related to gulp command it always throw an error like this

internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module 'gulp-util'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/usr/lib/nodejs/gulp/bin/gulp.js:4:13)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)

can someone help me?
so far i’ve tried some of this solutions:

Can’t get Gulp to run: cannot find module ‘gulp-util’

Cannot find module ‘gulp-util’

Issues with ionic: Error: Cannot find module ‘gulp-util’

and many more

okay i’ve been spending over a day to solve this gulp issue, i literally tried everything by run npm install after deleting node_modules or anything i find, but when i tried to run gulp or anything related to gulp command it always throw an error like this

internal/modules/cjs/loader.js:582
throw err;
^
Error: Cannot find module 'gulp-util'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:580:15)
at Function.Module._load (internal/modules/cjs/loader.js:506:25)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/usr/lib/nodejs/gulp/bin/gulp.js:4:13)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)

can someone help me?
so far i’ve tried some of this solutions:

Can’t get Gulp to run: cannot find module ‘gulp-util’

Cannot find module ‘gulp-util’

Issues with ionic: Error: Cannot find module ‘gulp-util’

and many more

Your Answer

StackExchange.ifUsing(«editor», function ()
StackExchange.using(«externalEditor», function ()
StackExchange.using(«snippets», function ()
StackExchange.snippets.init();
);
);
, «code-snippets»);

StackExchange.ready(function()
var channelOptions =
tags: «».split(» «),
id: «1»
;
initTagRenderer(«».split(» «), «».split(» «), channelOptions);

StackExchange.using(«externalEditor», function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using(«snippets», function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: ‘answer’,
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: «»,
imageUploader:
brandingHtml: «Powered by u003ca class=»icon-imgur-white» href=»https://imgur.com/»u003eu003c/au003e»,
contentPolicyHtml: «User contributions licensed under u003ca href=»https://creativecommons.org/licenses/by-sa/3.0/»u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href=»https://stackoverflow.com/legal/content-policy»u003e(content policy)u003c/au003e»,
allowUrls: true
,
onDemand: true,
discardSelector: «.discard-answer»
,immediatelyShowMarkdownHelp:true
);

);

Sign up or log in

StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave(‘#login-link’);
);

Sign up using Email and Password

Post as a guest

Email

Required, but never shown

StackExchange.ready(
function ()
StackExchange.openid.initPostLogin(‘.new-post-login’, ‘https%3a%2f%2fstackoverflow.com%2fquestions%2f53295076%2fgulp-always-throw-error-cannot-find-module-gulp-util%23new-answer’, ‘question_page’);

);

Post as a guest

Email

Required, but never shown

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Sign up or log in

StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave(‘#login-link’);
);

Sign up using Email and Password

Post as a guest

Email

Required, but never shown

StackExchange.ready(
function ()
StackExchange.openid.initPostLogin(‘.new-post-login’, ‘https%3a%2f%2fstackoverflow.com%2fquestions%2f53295076%2fgulp-always-throw-error-cannot-find-module-gulp-util%23new-answer’, ‘question_page’);

);

Post as a guest

Email

Required, but never shown

Sign up or log in

StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave(‘#login-link’);
);

Sign up using Email and Password

Post as a guest

Email

Required, but never shown

Sign up or log in

StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave(‘#login-link’);
);

Sign up using Email and Password

Post as a guest

Email

Required, but never shown

Sign up or log in

StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave(‘#login-link’);
);

Sign up using Email and Password

Sign up using Email and Password

Post as a guest

Email

Required, but never shown

Email

Required, but never shown

Email

Required, but never shown

Email

Required, but never shown

Email

Required, but never shown

Email

Required, but never shown

Email

Required, but never shown

Email

Required, but never shown

Email

Required, but never shown

Using Node.js version 10.9.1, but when I try to run a gulp process that runs node-sass, I get the following error. The npm rebuild node-sass command does nothing because the binary is actually correct. It is node-sass’s incorrect assumption that I’m running node version 8. I thought a path problem was it but running node –version obtains the version 10.9.1.

I end up changing my node version to 10.16.1, removing my node_modules directory, AND removing the package-lock.json file (I think this is key), and then running npm install. This fixed it for one machine but not on another.

Error I was getting


/home/jer0dh/PhpstormProjects/projectdevelopement/node_modules/node-sass/lib/binding.js:15
      throw new Error(errors.missingBinary());
      ^
Error: Missing binding /home/jer0dh/PhpstormProjects/projectdevelopement/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x

Found bindings for the following environments:
  - Linux 64-bit with Node.js 10.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
    at module.exports (/home/jer0dh/PhpstormProjects/projectdevelopement/node_modules/node-sass/lib/binding.js:15:13)
    at Object. (/home/jer0dh/PhpstormProjects/projectdevelopement/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object. (/home/jer0dh/PhpstormProjects/projectdevelopement/node_modules/gulp-sass/index.js:162:21)
jer0dh@jer0dh-ThinkPad:~/PhpstormProjects/projectdevelopement$ node --version
v10.9.0
jer0dh@jer0dh-ThinkPad:~/PhpstormProjects/projectdevelopement$ nvm use 10.16.1
Now using node v10.16.1 (npm v6.9.0)

UPDATE: The above worked for one machine but on another freshly installed linux Mint 19.2 workstation using Visual Code, the above did not help. Found possible solutions: https://stackoverflow.com/questions/44700432/visual-studio-code-to-use-node-version-specified-by-nvm

But it is happening in both the regular terminal and the Visual Code terminal. The path looks right.

/home/jer0dh/.nvm/versions/node/v10.16.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

I am wondering how node-sass determines the current version of node.

$ node --version
v10.16.1

It looks like it is getting it from /usr/bin

$ /usr/bin/node --version
v8.10.0

Yet the PATH shown above clearly shows it should be going directly to nvm node path first.

$ /home/jer0dh/.nvm/versions/node/v10.16.2/bin/node --version
v10.16.1

Without digging deeper down this rabbit hole. Let’s try to update this Linux Mint 19.2 distro with node 10.x using apt-get

We will use https://github.com/nodesource/distributions/blob/master/README.md

Unfortunately, Mint 19.2 “tina” is not supported yet. Only up to 19 “tara”. Added the nodesource tara repository, but getting:

E: The repository 'https://deb.nodesource.com/node_10.x tara Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

Notice there is a nodejs file in /usr/bin that is a pointer to /usr/bin/node. If I remove the nodejs file, gulp reports:

$ gulp
/usr/bin/gulp: 2: /usr/bin/gulp: /usr/bin/nodejs: not found

If I try to create /usr/bin/nodejs pointing to the v10.16.1 node file, gulp will not work but with a different error.

$ sudo ln -s /home/jer0dh/.nvm/versions/node/v10.16.1/bin/node nodejs

$  gulp
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'gulp-util'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)

If I copy /home/jer0dh/.nvm/versions/v10.16.1/bin/node to /usr/bin, I get the same error above running gulp.

Maybe what happened is that when I installed this box, I may have installed gulp using sudo apt install gulp which probably installed the 8.x version of node to /usr/bin.

As a test I installed Linux Mint Mate 19.0 ‘Tara’ and installed node using only nvm: https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/ and installed gulp using only npm install --global gulp-cli. I confirmed that neither node nor gulp were in the /usr/bin directory.

I cloned my project to a directory and ran npm install and then when I ran gulp, it actually worked.

The Solution for me

I went back to my Linux Mint 19.2 install and ran the following to clear out the apt-get installed gulp and node.

sudo apt-get remove gulp
sudo apt-get remove nodejs
sudo apt-get autoremove

I made sure I installed gulp the correct way:

npm install --global gulp-cli

I also made sure node still worked because it is still installed via nvm

Tried out my normal node-sass gulp tasks and….

Success!

Update: Found on another machine I would get the error of /usr/local/bin/gulp: No such file or directory when running gulp Found this stackexchange article fixed it: https://stackoverflow.com/questions/54986239/gulp-usr-local-bin-gulp-no-such-file-or-directory

By adding [[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh to my .profile

Содержание

  1. gulp-load-plugins as a dependency of a dependency not loading plugins #56
  2. Comments
  3. Footer
  4. Error: Cannot find module ‘gulp’ #1135
  5. Comments
  6. Не удается запустить Gulp: не удается найти модуль ‘gulp-util’
  7. ОБНОВИТЬ
  8. УСТАРЕВШИЙ ОТВЕТ
  9. Вам также необходимо установить gulp-util:
  10. Из глотка документов — начало работы (3.5) :
  11. Ошибка: не удается найти модуль ‘gulp -sass’
  12. ОТВЕТЫ
  13. Ответ 1
  14. Ответ 2
  15. Ответ 3
  16. Ответ 4
  17. Ответ 5
  18. Ответ 6
  19. Ответ 7
  20. Ответ 8
  21. Ответ 9
  22. Ответ 10
  23. Ошибка при установке npm модулей и запуске gulp #11
  24. Comments
  25. Сначала делаю npm i :
  26. На этапе запуска gulp :
  27. Сначала делаю npm i :
  28. На этапе запуска gulp :

gulp-load-plugins as a dependency of a dependency not loading plugins #56

EDIT: Remove all comments until this one: #56 (comment)

I think this is the same as #35.

I have the following project which I use to quickly load up gulp tasks in projects where I work without duplicating code: https://github.com/Lostmyname/lmn-gulp-tasks

Pretty much the same file structure described in this comment, and it’s looking in the top package.json, not the bottom one:

If I replace plugins.plumber( with just plumber( and require it manually, it errors about the next module instead.

Interestingly, it doesn’t happen if I npm link the lmn-gulp-tasks project in—it only happens when I actually install it through npm.

Any ideas what’s happening?

The text was updated successfully, but these errors were encountered:

README says this:

Wouldn’t __dirname be better?

console.log calls from /Users/callumacrae/Sites/lmn/monkey/node_modules/lmn-gulp-talks/index.js

Can send PR if you want one.

EDIT: Maybe not. Setting the config option to __dirname + ‘/package.json’ hasn’t fixed the problem. Interestingly, setting lazy to false throws a different error. Wat.

That error is thrown by the line calling gulp-load-plugins. Also that is not the path to gulp-load-plugins!

I apologise for vomiting text all over this issue! I was thinking through my keyboard, again.

It looks like it isn’t an issue with gulp-load-plugins: because I’m loading gulp-load-plugins both in my project, and in lmn-gulp-tasks, it’s only taking the first one, which isn’t working. It looks like it’s just a problem with node.

This is probably even more specific than the issue I initially linked to! I guess this is more a node question, but is there any way around this behaviour?

I’ve figured out the actual problem:

package.json (2) has gulp-load-plugins as a dependency, but because so does package.json (1), so it is loaded into node_modules (1).

When I call require(‘gulp-load-plugins’)() from lmn-gulp-tasks/index.js it runs the gulp-load-plugins from node_modules (1), so even though it’s got the correct package.json, it’s got the wrong node_modules directory and so cannot load the plugins.

Short of replicating part of the require function and setting options.requireFn , is there any way around this?

You should be able to replicate this on this branch of Lostmyname/monkey: https://github.com/Lostmyname/monkey/tree/lmn-gulp-tasks

Hey! Sorry for my slow reply, I have been away. Good stuff debugging this, this is really useful. Determined to try to track down the source of this bug and how we can fix it.

If I’m right, the below is the expected behaviour, right?

I can’t imagine we have to override require or reimplement some of it — I’m sure we can do this just by refining the code we have. I’ll try to dig into this if I get time soon.

Yeah, that’s the expected behaviour, and it’s attempting to use node_modules (1).

I spent quite a bit of time trying to work out a fix, and the best I came up with was basically reimplementing a lot of require : finding the module starting from the specified package.json, reading the main path, and including that. Haven’t written it yet, but would be willing to—this is making things tricky at work!

So npm@3 is going to exacerbate this issue even further by further flattening install trees. Could gulp-load-plugins look the package.json (maybe in addition to reading node_modules)? If you use read-package-json you’ll get exactly the same semantics npm has when reading them, including supporting some subtle corner cases and normalizing the fields.

I opened a pull request fixing this specific issue here, but it isn’t perfect either: #57

I’m not sure how reading the package.json would help in this case: wouldn’t it be best to read the node_modules file as in the PR I opened, and then use findup to look to see if the module is further up the tree?

i having similar sought of problem

Note: tasks projects is in node_modules folder.
i am having all gulp tasks as one project called «tasks» where it is having it’s own package.json.

when i am trying to use var $ = require(gulp-load-plugins)(); in «tasks» project which in turn finding it’s package.json in tasks folder rather it need to find node_modules/gulp-load-plugins/ package.json.
note: i am having index.js in tasks project.

when i renamed tasks/package.json to tasks/package1.json . everything is working fine.
any suggestions on this ? appreciated your help

@dulcedilip I think here you could override the config option and set the right path to the package.json you’d like it to use?

i resolved this problem in moving grunt-load-plugins to package.json into tasks project, which solved my problem. yeah i can use by override the config option i dont want to change core cwd.path.

Thanks for the support.

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Error: Cannot find module ‘gulp’ #1135

I have problem with gulp + gulpfile as symlink 🙁

So let`s check modules:

In gulpfile.js on row 13: var gulp = require(‘gulp’);

I don`t understand where is the problem. 🙁

Maybe anyone can see some problem that i don`t see. ?!

The text was updated successfully, but these errors were encountered:

Have you globally installed it too?

Your gulpfile is wayyy too deep and your node_modules are way too high up the tree. node only looks up a few directories for node_modules before saying it couldn’t find it. Look at the npm/node docs for more info, but it needs to be closer.

Oh, i understand what you mean. You are wright. Thanks a loooot!

Your gulpfile is wayyy too deep and your node_modules are way too high up the tree. node only looks up a few directories for node_modules before saying it couldn’t find it. Look at the npm/node docs for more info, but it needs to be closer.

I don’t think it’s true.

I get the same result for 100 subdirectories.

Don’t you think it’s a security risk to search for node_modules in upper directories (infinite or arbitrary number of levels)?

@wodny This is behavior in node, not something that we did — if you feel like this is a problem you should open an issue with the node.js team about it

@contra I see. Thank you for the information.

I am learning about gulp and trying to follow some instructions on how to get gulpfile to read, instead of no file found. I am currently getting this error:

C:devvstda>gulp
module.js:457
throw err;
^

Error: Cannot find module ‘gulpfile.js’
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Liftoff.handleArguments

I don’t understand where the problem is coming from?

Re-installing at a higher level worked for me. I’m not sure which was important to run, but I ran both $sudo npm install -g gulp@latest and $sudo npm install -g npm@latest, then $ionic serve finally stopped saying that gulp module was missing.

It seem is npm’s problem.I couldn’t find the file in the dictionary of gulp.But I want to know how to solve this problem.Install the latest gulp version?

I tried «npm update» command and it worked

Hi, i had the same problem only i was trying to use gulp awtch and it couldnt finde the moduels. Luckuly i fixed it.
My problem for this was that i had multiple files with the name gulp, so when i tried to use gulp watch this happened:

internal/modules/cjs/loader.js:883
throw err;
^

Error: Cannot find module ‘gulp-cli’
Require stack:

  • /usr/share/nodejs/gulp/bin/gulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object. (/usr/share/nodejs/gulp/bin/gulp.js:3:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) <
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [ ‘/usr/share/nodejs/gulp/bin/gulp.js’ ]
    >

when i used the «npm install —global gulp-cli» command in the terminal it showed me errors that sed that i all ready have files called gulp and told me all of the locations of the, so i deleted all of them and then ran the command again npm install —global gulp-cli and it works now. I hope this helps somebody.

Источник

Не удается запустить Gulp: не удается найти модуль ‘gulp-util’

  • npm install gulp -g
  • В моей папке приложения: npm install gulp —save-dev
  • Я создаю gulpfile.js файл.

Но затем, когда я пытаюсь запустить gulp , я получаю это сообщение об ошибке:

Но gulp-util присутствует (в локальной папке приложения) в:

Есть идеи, что может быть причиной?

ОБНОВИТЬ

В более поздних версиях нет необходимости вручную устанавливать gulp-util.

Если вы все еще сталкиваетесь с этой проблемой, попробуйте переустановить локальные пакеты вашего проекта:

УСТАРЕВШИЙ ОТВЕТ

Вам также необходимо установить gulp-util:

Из глотка документов — начало работы (3.5) :

Установите gulp и gulp-util в вашем проекте devDependencies

Если у вас есть package.json, вы можете установить все текущие зависимости проекта, используя:

Любой ответ не помог в моем случае. В конечном итоге помогло удаление bower и gulp (я использую их обоих в своем проекте):

После этого я установил их снова:

Теперь это работает просто отлично.

Попробуйте установить отсутствующий модуль.

Вы должны установить их как devDependencies:
— gulp-util
— gulp-load-plugins

Затем вы можете использовать их так:

Пользователь Linux Ubuntu 18:04 здесь. Я перепробовал все решения на этой доске до настоящего времени. Несмотря на то, что я прочитал выше в принятом ответе, что «В более поздних версиях нет необходимости устанавливать gulp-util вручную». Это была вещь, которая работала для меня. (. может быть, я нахожусь на Ubuntu? Я не знаю.)

Напомним, что я продолжал получать ошибку « not find module ‘gulp-util’ », когда просто проверял, был ли установлен gulp, запустив:

. опять появляется ошибка «gulp-util» .

Итак, я следовал совету npm install [имя пакета], указанному выше, но в итоге получил несколько других пакетов, которые также нужно было установить. И у одной была проблема уже существующей, и я не был уверен, как ее заменить. . Я добавлю здесь все команды package / install, которые мне пришлось использовать, просто для справки на случай, если кто-то еще столкнется с этой проблемой:

(затем я получил сообщение об ошибке «pretty-hrtime», поэтому я добавил это, а затем другие сообщения об ошибке: «Не удается найти модуль ___, который продолжал появляться после каждой проверки gulp —version. . поэтому я просто продолжал устанавливать каждую из них»). )

(без —force в моей системе я получил ошибку: «EEXIST: файл уже существует, символическая ссылка». —force не рекомендуется, но идите другим путем.)

И теперь gulp —version наконец-то показывает: CLI version 3.9.1 Local version 3.9.1

Источник

Ошибка: не удается найти модуль ‘gulp -sass’

Когда я компилирую с gulp , я получаю сообщение об ошибке, как показано ниже. Как я могу это исправить?

ОТВЕТЫ

Ответ 1

Просто сделайте npm update , а затем npm install gulp-sass —save-dev в корневой папке, а затем, когда вы запустите, вы не должны иметь никаких проблем.

Ответ 2

Вы проверили этот вопрос?

Ответ 3

Отредактируйте ваш package.json. Изменить:

Удалите папку node_modules и снова запустите npm install .

Ответ 4

У меня была та же проблема, и я решил сделать это npm update . Но я получаю сообщение о разрешении, поэтому я запускаю:

Этот набор разрешений для моего пользователя запускает команды npm, такие как администратор. Затем я запускаю это снова:

Тогда моя проблема с этим была решена.

Ответ 5

У меня была такая же проблема на моем новом компьютере с Windows 10. Мне пришлось использовать инструменты сборки Windows с помощью npm install -g windows-build-tools . (https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#environment-setup-and-configuration)

Ответ 6

Ответ 7

я также столкнулся с той же проблемой, возможное решение состоит в том, чтобы установить модуль npm install -g gulp-sass , но если вы запустите npm install -g gulp-sass команду: npm install -g gulp-sass или npm install —save gulp-sass , это не будет быть обновленным в конце проекта sass-node.

Эта версия node-sass отсутствует (возвращает 404) и Google Web-Starter-Kit v0.6.5 зависел от него в течение длительного времени, с декабря 2016 года. Таким образом, он работал в течение длительного времени и должен иметь только исчез.

Ошибка HTTP 404 Не найдено

Единственный обходной путь — обновить node-sass: npm я [email protected] —save-dev чтобы исправить проблему.

Ответ 8

В корневой папке, где находится package.json , запустите npm outdated . Вы получите устаревшие пакеты с некоторыми подробностями. В этих деталях вы увидите номер текущей версии устаревшего пакета.

После этого откройте файл package.json и вручную измените номер версии соответствующего пакета.

Затем удалите папку node_modules и запустите npm install . Это должно решить эту проблему.

Ответ 9

У меня была такая же ошибка на Ubuntu 18.04

Удалите папку node_modules и запустите

Ответ 10

У меня была эта проблема в течение нескольких дней, ища ответы. Мой журнал ошибок был похож на этот npm просто не установит node sass Единственной проблемой была версия node. Возможно, это может помочь некоторым из вас.

Источник

Ошибка при установке npm модулей и запуске gulp #11

Добрый день. Пытаюсь установить модули для optimizedHTML-5 .

Сначала делаю npm i :

` npm i
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated — replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated lodash.createcallback@2.4.4: This package is discontinued. Use lodash.iteratee@^4.0.0.

node-sass@4.12.0 install C:OSPaneldomainsaaanode_modulesnode-sass
node scripts/install.js

Cached binary found at C:UsersdesunAppDataRoamingnpm-cachenode-sass4.12.0win32-x64-72_binding.node

sharp@0.21.3 install C:OSPaneldomainsaaanode_modulessharp
(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached C:UsersdesunAppDataRoamingnpm-cache_libvipslibvips-8.7.0-win32-x64.tar.gz
info sharp Creating C:OSPaneldomainsaaanode_modulessharpbuildRelease
info sharp Copying DLLs from C:OSPaneldomainsaaanode_modulessharpvendorlib to C:OSPaneldomainsaaanode_modulessharpbuildRelease
prebuild-install WARN install No prebuilt binaries found (target=12.12.0 runtime=node arch=x64 libc= platform=win32)

C:OSPaneldomainsaaanode_modulessharp>if not defined npm_config_node_gyp (node «C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin. node_modulesnode-gypbinnode-gyp.js» rebuild ) else (node «C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js» rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can’t find Python executable «python», you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibconfigure.js:484:19)
gyp ERR! stack at PythonFinder. (C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibconfigure.js:509:16)
gyp ERR! stack at C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesgraceful-fspolyfills.js:282:31
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command «C:Program Filesnodejsnode.exe» «C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js» «rebuild»
gyp ERR! cwd C:OSPaneldomainsaaanode_modulessharp
gyp ERR! node -v v12.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 — 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN optimizedhtml@5.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted <«os»:»darwin»,»arch»:»any»>(current: <«os»:»win32″,»arch»:»x64″>)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.21.3 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.21.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersdesunAppDataRoamingnpm-cache_logs2019-10-16T20_27_29_659Z-debug.log
`

На этапе запуска gulp :

`$ gulp
internal/modules/cjs/loader.js:797
throw err;
^

Error: Cannot find module ‘gulp-responsive’
Require stack:

  • C:OSPaneldomainsaaagulpfile.js
  • C:UsersdesunAppDataRoamingnpmnode_modulesgulp-clilibversioned^4.0.0index.js
  • C:UsersdesunAppDataRoamingnpmnode_modulesgulp-cliindex.js
  • C:UsersdesunAppDataRoamingnpmnode_modulesgulp-clibingulp.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object. (C:OSPaneldomainsaaagulpfile.js:11:18)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19) <
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [
    ‘C:OSPaneldomainsaaagulpfile.js’,
    ‘C:UsersdesunAppDataRoamingnpmnode_modulesgulp-clilibversioned^4.0.0index.js’,
    ‘C:UsersdesunAppDataRoamingnpmnode_modulesgulp-cliindex.js’,
    ‘C:UsersdesunAppDataRoamingnpmnode_modulesgulp-clibingulp.js’
    ]
    >
    `

The text was updated successfully, but these errors were encountered:

или можете убрать зависимость gulp-responsive в package.json и gulpfile.js

Добрый день. Пытаюсь установить модули для optimizedHTML-5 .

Сначала делаю npm i :

` npm i
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated — replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated lodash.createcallback@2.4.4: This package is discontinued. Use lodash.iteratee@^4.0.0.

node-sass@4.12.0 install C:OSPaneldomainsaaanode_modulesnode-sass
node scripts/install.js

Cached binary found at C:UsersdesunAppDataRoamingnpm-cachenode-sass4.12.0win32-x64-72_binding.node

sharp@0.21.3 install C:OSPaneldomainsaaanode_modulessharp
(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached C:UsersdesunAppDataRoamingnpm-cache_libvipslibvips-8.7.0-win32-x64.tar.gz
info sharp Creating C:OSPaneldomainsaaanode_modulessharpbuildRelease
info sharp Copying DLLs from C:OSPaneldomainsaaanode_modulessharpvendorlib to C:OSPaneldomainsaaanode_modulessharpbuildRelease
prebuild-install WARN install No prebuilt binaries found (target=12.12.0 runtime=node arch=x64 libc= platform=win32)

C:OSPaneldomainsaaanode_modulessharp>if not defined npm_config_node_gyp (node «C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin. node_modulesnode-gypbinnode-gyp.js» rebuild ) else (node «C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js» rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can’t find Python executable «python», you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibconfigure.js:484:19)
gyp ERR! stack at PythonFinder. (C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gyplibconfigure.js:509:16)
gyp ERR! stack at C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesgraceful-fspolyfills.js:282:31
gyp ERR! stack at FSReqCallback.oncomplete (fs.js:158:21)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command «C:Program Filesnodejsnode.exe» «C:UsersdesunAppDataRoamingnpmnode_modulesnpmnode_modulesnode-gypbinnode-gyp.js» «rebuild»
gyp ERR! cwd C:OSPaneldomainsaaanode_modulessharp
gyp ERR! node -v v12.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 — 3 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of popper.js@^1.14.7 but none is installed. You must install peer dependencies yourself.
npm WARN optimizedhtml@5.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted <«os»:»darwin»,»arch»:»any»>(current: <«os»:»win32″,»arch»:»x64″>)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.21.3 install: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.21.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersdesunAppDataRoamingnpm-cache_logs2019-10-16T20_27_29_659Z-debug.log
`

На этапе запуска gulp :

`$ gulp
internal/modules/cjs/loader.js:797
throw err;
^

Error: Cannot find module ‘gulp-responsive’
Require stack:

Источник

Понравилась статья? Поделить с друзьями:
  • Error cannot find module gulp concat
  • Error cannot find module gulp cli
  • Error cannot find module glob
  • Error cannot find module express session
  • Error cannot find module eslint webpack plugin