跳过 Gulp 的本地安装 [英] Skip local installation of Gulp

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

问题描述

我可以以某种方式跳过 Gulp 的本地安装到项目中吗?

Can I somehow skip local installation of Gulp to the project?

我全局安装了 Gulp,并将其作为依赖项添加到 package.json.但是 Gulp 仍然希望通过 Local gulp not found in ... 消息在本地安装.如果我进行本地安装,Gulp 会按节点复制到我的项目中.

I installed Gulp globally, added it to package.json as a dependency. But still Gulp wants to be installed locally also with the Local gulp not found in ... message. If I do local install, Gulp is copied into my project by node.

有没有办法跳过 Gulp 的本地安装?我希望能够从命令行在整个服务器上运行它并全局管理它的安装.

Is there a way to skip local installation of Gulp? I want to be able to run it across the whole server from command line and manage it installation globally.

推荐答案

做到这一点的一种干净的方法是在本地没有它是像你一样全局安装 gulp 然后在你的目录中运行命令:

One clean way to do this is without have it locally is to install gulp globally like as you did and then run in your directory the command :

npm link gulp

它将在您的 node_modules 文件夹中创建一个指向全局 gulp 安装的符号链接.您需要注意版本,因为您的所有符号链接以及本地项目都将使用全局符号链接,无论 package.json 中定义的版本如何,这可能会导致错误已部署的环境.

It will create a symbolic link in your node_modules folder to your global gulp install. You need to be careful on the versions since all your symlinks and therefore your local project(s) will use the global one, no matter of the defined version in the package.json, which could cause errors on a deployed environment.

这也适用于每个节点包,并允许您一次更新以这种方式创建的多个项目的本地安装.

This is also applicable for every node package, and allow you to update the local install you've created that way of multiple projects at once.

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

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