search

Home  >  Q&A  >  body text

When using the command in Git bush, an error will be reported, saying that the module cannot be found in the Git directory.

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中文网2804 days ago999

reply all(1)I'll reply

  • 漂亮男人

    漂亮男人2017-05-02 09:51:37

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

    reply
    0
  • Cancelreply