Thank you, in versions below npm 4 you can directly copy the gulp package to the global module path
/usr/lib/node_modules/
But after npm 4, npm also adopts a flat installation method. The dependencies no longer exist in the gulp package directory, but in the same level directory as the gulp package. Therefore, you need to copy the dependencies to the global module path, but this It’s easy to make mistakes
Seeing the adopted answer, the respondent also said that this is error-prone. I think copying to the global module path, if copied by dragging and other methods under Windows, may fail because the path name of the dependent package is too long.
I just tried the method I mentioned in the comment, npm install <folder> -g
npm install <folder>: Install a package that is sitting in a folder on the filesystem.
In the beginning, my global npm only had these
So, I went to a vue demo project and found the vue directory
Thank you, in versions below npm 4 you can directly copy the gulp package to the global module path
But after npm 4, npm also adopts a flat installation method. The dependencies no longer exist in the gulp package directory, but in the same level directory as the gulp package. Therefore, you need to copy the dependencies to the global module path, but this It’s easy to make mistakes
Seeing the adopted answer, the respondent also said that this is error-prone. I think copying to the global module path, if copied by dragging and other methods under Windows, may fail because the path name of the dependent package is too long.
I just tried the method I mentioned in the comment,
npm install <folder> -g
In the beginning, my global npm only had these
So, I went to a vue demo project and found the vue directory
Then
Result: