无法让 Gulp 运行:找不到模块“gulp-util" [英] Can't get Gulp to run: cannot find module 'gulp-util'
问题描述
在 Windows 7 上,我已经按照此处的说明安装了 gulp:http://markgoodyear.com/2014/01/getting-started-with-gulp/:
npm install gulp -g
- 在我的应用文件夹中:
npm install gulp --save-dev
- 我创建了一个
gulpfile.js
文件.
但是,当我尝试运行 gulp
时,我收到此错误消息:
module.js:340抛出错误;^错误:无法归档模块gulp-util"在 Function.Module._resolveFilename (module.js:338:15)
等
但是 gulp-util
存在于(在本地应用程序文件夹中):
node_modules吞咽节点模块吞咽工具
知道可能是什么原因吗?
UPDATE
以后的版本不需要手动安装gulp-util.
查看新的入门页面.
如果您仍然遇到此问题,请尝试重新安装项目的本地包:
rm -rf node_modules/安装
<小时>
过时的答案
您还需要安装 gulp-util:
npm install gulp-util --save-dev
来自 gulp 文档 - 入门 (3.5):
<块引用>在您的项目 devDependencies
中安装 gulp 和 gulp-utilOn 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屋!