Gulp失败,消息:对象预期

编程入门 行业动态 更新时间:2024-10-09 01:22:36
本文介绍了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:

  • 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失败,消息:对象预期

    本文发布于:2023-11-25 10:18:45,感谢您对本站的认可!
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:对象   消息   Gulp

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!