无法运行Gulp:无法找到模块'gulp-util' [英] Can't get Gulp to run: cannot find module 'gulp-util'

查看:907
本文介绍了无法运行Gulp:无法找到模块'gulp-util'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows 7上,我已经按照以下说明安装了gulp: http: //markgoodyear.com/2014/01/getting-started-with-gulp/


  • npm install gulp -g

  • 在我的app文件夹中: npm install gulp --save-dev

  • 我创建一个 gulpfile.js 文件。



但是,当我尝试运行 gulp 时,出现以下错误消息:

  module.js:340 
throw err;
^
错误:无法在Function.Module._resolveFilename(module.js:338:15)处输入模块'gulp-util'

等。



gulp-util 存在(在本地应用程序文件夹中):

  node_modules 
吞噬
node_modules
gulp-util

任何想法可能是原因?
<从更高版本开始,不需要手动安装gulp-util。

>

查看新的入门页面 a>。



如果您仍然遇到此问题,请尝试重新安装您项目的本地软件包:

  rm -rf node_modules / 
npm install






OUTDATED ANSWER



您还需要安装gulp-util:



  npm install gulp-util --save-dev 



gulp文档 - 入门(3.5)




在您的项目devDependencies 中安装gulp和 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 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?

解决方案

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

这篇关于无法运行Gulp:无法找到模块'gulp-util'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆