如何安装 gulp 4 [英] How do I install gulp 4

查看:52
本文介绍了如何安装 gulp 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 gulp-watch.当前版本的 gulp-watch 依赖于调用 gulp.parallel.此调用仅在 gulp 4 中可用.

I've been using gulp-watch. The current version of gulp-watch relies on the call gulp.parrallel. This call is only available from gulp 4.

但是 gulp 4 不能通过 npm repo 获得.npm info gulp dist-tags 返回:{ latest: '3.9.0' }.

However gulp 4 is not available via the npm repo. npm info gulp dist-tags returns: { latest: '3.9.0' }.

我可以看到 git repo 中有一个 4.0 分支.但是尝试使用此命令的变体安装它会失败:npm install https://github.com/gulpjs/gulp#v4.0.0.

I can see that there is a 4.0 branch within the git repo. But attempting to install it with variations on this command fails: npm install https://github.com/gulpjs/gulp#v4.0.0.

推荐答案

Gulp 已经从他们的 GitHub 仓库中删除了 4.0 分支,所以之前使用 npm install gulpjs/gulp.git#4.0 --save 安装的方式-dev 不再有效.

Gulp has removed the 4.0 branch from their GitHub repository, so the previous way of installing using npm install gulpjs/gulp.git#4.0 --save-dev no longer works.

他们在 README 中声明,安装 gulp 4.0 的正确方法是运行命令:

They state in their README that the correct way to install gulp 4.0 is to run the command:

npm install gulp@next

这篇关于如何安装 gulp 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆