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

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

问题描述

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

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



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

这样做是没有它本地安装 gulp 全局像你一样,然后在你的目录中运行命令:

  npm link gulp 

它会在您的<$ c $中创建一个符号链接c> node_modules 文件夹添加到您的全局 gulp 安装中。你需要小心版本,因为所有的符号链接,因此你的本地项目将使用全局的,不管在 package.json 中定义的版本, ,这可能会在部署的环境中导致错误。



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


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

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.

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.

解决方案

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

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天全站免登陆