iT邦幫忙

0

VS Code 執行 gulp 任務錯誤 The terminal process terminated with exit code: 127

  • 分享至 

  • xImage

一年以來都是用同一套 package.json 在開專案,
今天心血來潮想說來整理一下將各個套件升級但不知為何一直失敗,
一氣之下砍了全部重裝,結果現在連 gulp 任務都無法順利執行QQ

MacOS High Sierra 版本 10.13.6
VS Code 版本 1.27.2
npm 版本 6.4.1

terminal 報錯

> Executing task: gulp <

/bin/bash: gulp: command not found
The terminal process terminated with exit code: 127

Terminal will be reused by tasks, press any key to close it.

tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "default",
            "command": "gulp",
            "type": "shell",
            "group": "build",
            "isBackground": true,
            "presentation": {
                "reveal": "always"
            }
        }
    ]
}

package.json

{
  "name": "01",
  "version": "1.0.0",
  "description": "",
  "main": "gulpfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "browser-sync": "^2.24.7",
    "gu": "^0.6.2",
    "gulp": "^4.0.0",
    "gulp-sass": "^4.0.1",
    "gulp-sourcemaps": "^1.0.1"
  }
}

但是如果是用之前的 package.json 是沒有問題的...猜想是否為版本的問題(如下

{
  "name": "02",
  "version": "1.0.0",
  "main": "gulpfile.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "browser-sync": "^2.23.6",
    "gu": "^0.6.2",
    "gulp": "^3.9.1",
    "gulp-sass": "^3.1.0",
    "gulp-sourcemaps": "^2.6.1"
  },
  "dependencies": {},
  "description": ""
}

爬了很多文仍無法解決所以在此請求協助,
如果這樣的流程上有錯誤也希望可以告訴我,
本身非工程師背景一切操作設定都是網路上爬文來的...非常感謝!

fillano iT邦超人 1 級 ‧ 2018-10-02 14:17:31 檢舉
錯誤訊息看起來是根本沒找到gulp這個執行檔 ...
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答