Issues with ionic: Error: Cannot find module 'gulp-util'

六眼飞鱼酱① 提交于 2019-12-10 15:11:31

问题


I've got some issues with trying to run gulp with Ionic.

The error message that pops up is this:

Error: Cannot find module 'gulp-util'

at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object. (/Users/emilymacleod/Desktop/myApp/gulpfile.js:2:13) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17)

I tried installing sass and gulp locally in the myApp folder as well as globally and no dice.

Thoughts?


回答1:


Kind of a long shot, but gulp-util is a separated module. You should install it locally:

npm install gulp gulp-util --save-dev

and require it in your code:

var gutil = require('gulp-util');



回答2:


I'm having the problem of cannot find gulp-util even after doing the procedure at the end of this. I can see it's added to the modules and the package.json, but that require statement seems to have an error. It doesn't seem to be working.

The PROCEDURE

npm install gulp gulp-util --save-dev and require it in your code: var gutil = require('gulp-util');




回答3:


I had similar issue with gulp-sass. Error message was:
Uh oh! Looks like you're missing a module in your gulpfile: Cannot find module 'gulp-sass'

Do you need to run npm install?

Resolved by executing the following:

  • npm -g install npm
  • npm install gulp-sass

Hope this help.



来源:https://stackoverflow.com/questions/28176356/issues-with-ionic-error-cannot-find-module-gulp-util

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!