搜尋

首頁  >  問答  >  主體

node.js - git bash安装gulp报错,Error: Cannot find module

使用git bash 安装gulp时,出现错误,运行gulp -v,出现如下错误:

SNSD@SNSD MINGW64 ~
$ npm install -g gulp
npm WARN deprecated lodash.isarray@4.0.0: This package is deprecated. Use Array.isArray.
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
C:\Users\SNSD\AppData\Roaming\npm\gulp -> C:\Users\SNSD\AppData\Roaming\npm\node_modules\gulp\bin\gulp.js
C:\Users\SNSD\AppData\Roaming\npm
`-- gulp@3.9.1


SNSD@SNSD MINGW64 ~
$ gulp -v
module.js:457
    throw err;
    ^

Error: Cannot find module 'C:\Program Files\Git\node_modules\gulp\bin\gulp.js'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
迷茫迷茫2778 天前879

全部回覆(3)我來回復

  • 天蓬老师

    天蓬老师2017-04-17 14:58:38

    這是git?這是node.js的套件管理庫npm,有些外掛程式需要更新後,再安裝gulp

    回覆
    0
  • 高洛峰

    高洛峰2017-04-17 14:58:38

    你試試 NODE 自己的 node command 終端機進行安裝
    用 git bash 可能環境不一樣

    回覆
    0
  • 高洛峰

    高洛峰2017-04-17 14:58:38

    今天我把node_modules資料夾複製到Git安裝目錄下之後,就正常了。但是我以前沒有這樣操作過,也可以運行的啊。這是什麼情況啊?

    回覆
    0
  • 取消回覆