Gulp run fails on windows | Error Message : Microsoft JScript compilation error, Invalid character
Asked Answered
R

1

7

I installed Node.js on my windows 7 local machine as this link says :
install-node-js-npm-windows

After that i installed Gulp.js by this command through command line :

npm install -g gulp

And then i add this path to environment variables area :

C:\Users\Majid\AppData\Roaming\npm\node_modules\gulp\bin

Now when i try to run gulp by this command :

gulp

I got this error :

Gulp run error message

Windows Script Host
Line: 1
Char: 1
Error: Invalid character
Code: 800A03F6
Source: Microsoft JScript compilation error   

How can i solve this error & how can i make gulp.js workable on windows OS?


EDIT AFTER THE ANSWER :
Error is still there.
I went to this path :

C:\Users\User_Name\AppData\Roaming\npm\node_modules\gulp\bin

In command line and tried this command :

node gulp.js install  

But it tells :

No gulpfile found

You should know gulp was installed in previous steps successfully.(With some warnings)
The structure of gulp.js is for linux based operating systems.
I am looking for a way to make this file workable on windows os.



USAGE :
I want to run this javascript based web site on my local machine...
Realistic answered 17/5, 2016 at 23:12 Comment(0)
L
6

You need to run "node node_modules\gulp\bin\gulp.js install", just add "node" command in front of it and also refer to the link below for more

Error running gulp on Windows 10

I can't comment but did you run "npm install" after forking the repository, to install package.json "dependencies, dev-dependencies"?

Gulp need to be installed Globally and also in your current working directory.

Run the code below to installed Gulp globally, and the other to install the repository dependencies.

npm install -g gulp
npm install

This answer is correct, But what was the problem in my side?
I shouldn't add this path :

C:\Users\Majid\AppData\Roaming\npm\node_modules\gulp\bin

To environment variable area.

I went to the root folder in cmd & reinstalled gulp globally and re ran npm install & finally gulp watch worked very well.

Lida answered 17/5, 2016 at 23:24 Comment(3)
Here is the meaning of "npm install" : By default, "npm install" will install all modules listed as dependencies in package.json.Realistic
@MoonLight Yes true, that is what "npm install" will do, and yes you have to run it on the root folder of the project, just like you said it will install all modules listed as dependencies in package.jsonLida
@MoonLight I would suggest you uninstall global gulp and reinstallLida

© 2022 - 2024 — McMap. All rights reserved.