Gulp fails with message: object expected

僤鯓⒐⒋嵵緔 提交于 2020-01-01 02:13:26

问题


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?


回答1:


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 > npm install -g gulp
  3. Test installation > gulp -v

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




回答2:


If you're getting a Microsoft JScript runtime error it isn't running in node but rather in Windows Scripting Host. Ensure Node.exe is in your PATH.



来源:https://stackoverflow.com/questions/22461440/gulp-fails-with-message-object-expected

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!