When using the command in Git bush, an error will be reported, saying that the module cannot be found in the Git directory.
PHP中文网
PHP中文网 2017-05-02 09:49:37
0
1
992

Install a package globally in git bash, for example npm install -g gulp, and it can be installed successfully.
But when using gulp --help an error occurs:

`Error: Cannot find module 'C:\Program Files\Git\node_modules\gulp\bin\gulp.js'`

Other globally installed packages also encountered similar problems. The current temporary solution: is to copy the node_modules folder in the user directory of the C drive to the git installation directory.

But it is normal to use it in cmd, and the environment variables are also set. What is the reason? Is there a one-time solution?

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
漂亮男人

Try to modify the default installation directory of npm package
npm config set prefix xxxxx

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template