問題描述
我在我的 Windows 7 本地機器上安裝了 Node.js,因為這個鏈接說:
install-node-js-npm-windows
I installed Node.js on my windows 7 local machine as this link says :
install-node-js-npm-windows
之后我通過命令行通過這個命令安裝了Gulp.js:
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:UsersMajidAppDataRoaming pm ode_modulesgulpin
C:UsersMajidAppDataRoaming pm ode_modulesgulpin
現在當我嘗試通過這個命令運行 gulp 時:
Now when i try to run gulp by this command :
gulp
我收到了這個錯誤:
Windows Script Host
Line: 1
Char: 1
Error: Invalid character
Code: 800A03F6
Source: Microsoft JScript compilation error
我該如何解決這個錯誤&如何使 gulp.js 在 Windows 操作系統上可用?
<小時>回答后
錯誤仍然存??在.
我去了這條路:
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:UsersUser_NameAppDataRoaming pm ode_modulesgulpin
C:UsersUser_NameAppDataRoaming pm ode_modulesgulpin
在命令行中嘗試了這個命令:
In command line and tried this command :
node gulp.js install
但它告訴我們:
沒有找到 gulpfile
No gulpfile found
您應該知道 gulp 在前面的步驟中已成功安裝.(帶有一些警告)
gulp.js 的結構適??用于基于 linux 的操作系統.
我正在尋找一種使該文件在 Windows 操作系統上可用的方法.
用法:
我想在我的本地機器上運行 這個基于 javascript 的網站...
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...
推薦答案
你需要運行node node_modulesgulpingulp.js install",在它前面加上node"命令,同時參考更多詳情請點擊下方鏈接
You need to run "node node_modulesgulpingulp.js install", just add "node" command in front of it and also refer to the link below for more
在 Windows 10 上運行 gulp 時出錯
我無法發表評論,但您是否在 fork 存儲庫后運行npm install"來安裝 package.json dependencies, dev-dependencies"?
I can't comment but did you run "npm install" after forking the repository, to install package.json "dependencies, dev-dependencies"?
Gulp 需要全局安裝,也需要安裝在您當前的工作目錄中.
Gulp need to be installed Globally and also in your current working directory.
運行以下代碼全局安裝 Gulp,另一個安裝存儲庫依賴項.
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:UsersMajidAppDataRoaming pm ode_modulesgulpin
C:UsersMajidAppDataRoaming pm ode_modulesgulpin
到環境變量區.
我去了根文件夾在cmd &全局重新安裝 gulp 并重新運行 npm install &最后 gulp watch 工作得很好.
I went to the root folder in cmd & reinstalled gulp globally and re ran npm install & finally gulp watch worked very well.
這篇關于Gulp 在 Windows 上運行失敗 |錯誤消息:Microsoft JScript 編譯錯誤,無效字符的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!