Gulp失败,消息:对象预期 [英] Gulp fails with message: object expected
问题描述
如果我开始没有gulp文件的gulp,它运行良好..说'没有找到gulpfile'
gulp -v给出:cli版本3.5.6,本地版本3.5.6
安装它使用:
npm install -g gulp
npm install --save -dev gulp
如果我使用以下gulp文件:
var gulp = require('gulp');
导致错误对话框:
Windows脚本宿主
行1
字符1
对象预期
800A138F
Microsoft JScript运行时错误
我尝试了一个更长的吞食文件,但同样的错误...通过删除行,我试图隔离问题..直到该文件是空的..这是确定的。
任何想法?
以下是我用来解决该问题的步骤:如果您的任务文件是gulp.js,则将其重命名为gulpfile.js
sh cmd> npm install -g gulp
sh cmd> gulp -v
如果你能看到你的gulp task runner的版本号, / p>
I'm trying to use gulp on w7. gruntjs works .. node works ... If i start gulp without gulp file, it runs fine .. saying 'no gulpfile found'
gulp -v gives: cli version 3.5.6, local version 3.5.6
installed it using: npm install -g gulp npm install --save-dev gulp
If I use the following gulpfile:
var gulp = require('gulp');
It results in error dialog:
Windows Script Host
Line 1
Char 1
Object Expected
800A138F
Microsoft JScript runtime error
I did try a more lengthy gulp file, but same error ... by deleting lines, I tried to isolate the problem .. until the file was empty .. that was ok.
Any ideas?
Here are steps I used to solve that issue:
- if your tasks file is gulp.js, rename it to gulpfile.js
- Install gulp globally
sh cmd> npm install -g gulp
- Test installation
sh cmd> gulp -v
You are good if you can see the version number of your gulp task runner!
这篇关于Gulp失败,消息:对象预期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!