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

匿名 (未验证) 提交于 2019-12-03 00:48:01

问题:

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 :

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...

回答1:

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.



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