最近在捣鼓gulp前端自动化工具,全局已经安装好了gulp,将命令行切换到自己项目中安装好gulp和gulp模块后执行,结果提示:
[gulp] Warning: Gulp version mismatch: [gulp] Global gulp is 3.9.0 [gulp] Local gulp is 1.0.0
试过通过npm unistall gulp命令卸载,提示gulp不存在。遂google之…
然后找到了答案,英文原文:
There are two gulp versions. The CLI, and the project specific installed version.
To check the CLI and local version run: gulp -v
To check the Installed project version via npm run: npm ls and look for gulp
Update the project specific version to 3.3.4 to solve that issue.
From a terminal in your project folder:npm install gulp@3.3.4 –save
大概意思就是说手动指定版本安装,就可以解决。
用这个命令:npm install gulp@3.3.4 --save
,这里的3.3.4可以改成你需要的版本,一般改成最新版的即可。