Gulp失败,消息:对象预期 [英] Gulp fails with message: object expected

查看:152
本文介绍了Gulp失败,消息:对象预期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在w7上使用gulp。 gruntjs作品..节点作品...
如果我开始没有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

  • 全球安装gulp 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:

    1. if your tasks file is gulp.js, rename it to gulpfile.js
    2. Install gulp globally sh cmd> npm install -g gulp
    3. Test installation sh cmd> gulp -v

    You are good if you can see the version number of your gulp task runner!

    这篇关于Gulp失败,消息:对象预期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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