使用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
Is this git? This is the node.js package management library npm. Some plug-ins need to be updated before installing gulp
You can try NODE’s own node command terminal for installation
The environment may be different if you use git bash
After I copied the node_modules folder to the Git installation directory today, it became normal. But I have never done this before, and it works. What is going on?