简体   繁体   English

Git Bash - Gulp:无法执行命令“gulp”; 错误:找不到模块

[英]Git Bash - Gulp: Can't execute command “gulp”; Error: Cannot find module

I'm following a Udemy Tutorial on Bootstrap. 我正在关注Bootstrap的Udemy教程。
I'm inside the folder C:/bs4projects/bs4starter in Git Bash but when I run the command " gulp ", it will give me this error: 我在Git Bash中的文件夹C:/bs4projects/bs4starter里面但是当我运行命令“ gulp ”时,它会给我这个错误:

Error: Cannot find module 'C:\c\Users\[username]\AppData\Roaming\npm\node_modules\gulp-cli\bin\gulp.js 

I noticed that it's adding an extra folder called " c " on the path and I don't know how to change the PATH of where it should should look for. 我注意到它在路径上添加了一个名为c的额外文件夹,我不知道如何更改它应该寻找的位置的PATH
I also noticed that it isn't looking for gulp.js that is inside my bs4starter folder. 我还注意到,这是不是找gulp.js这是我的内bs4starter文件夹。
Please help, been trying to find solutions all day. 请帮忙,一直试图找到解决方案。

I checked my gulp.js both installed in my bs4starter folder and in \\npm\\node_modules\\gulp-cli folder and they're both there so I think I installed it correctly. 我检查了我的gulp.js它们都安装在我的bs4starter文件夹和\\npm\\node_modules\\gulp-cli文件夹中,它们都在那里,所以我认为我正确安装了它。

错误

In Git bash, check your $PATH 在Git bash中,检查你的$ PATH

echo $PATH

You can fix it with 你可以修复它

export PATH=/c/Users[username]/AppData/Roaming/npm/node-modules/gulp-cli/bin:...(rest of the $PATH)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM