我可以在全球范围内仅安装Gulp吗? [英] Can I install just Gulp globally?

查看:218
本文介绍了我可以在全球范围内仅安装Gulp吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在从事新的Web开发项目,实际上在部署时不需要它们的node_modules文件夹.如果我能够为每个项目创建一个小的gulpfile.js,而不是每个项目在node_modules文件夹中包含的6000多个文件,而这些文件只能由我在这台计算机上使用,那么这将更适合我. /p>

我只使用Gulp编译SASS并为CSS加上前缀和最小化.我不需要担心任何其他类型的部署问题,但是文档说我同时需要:Gulp的全局和本地副本.

解决方案

Gulp需要在本地安装,但是您可以将本地安装链接到全局安装:

npm install --global gulp
npm link gulp

另请参见 https://stackoverflow.com/a/30742196/451480

I'm constantly working on new web development projects that don't ever, in practice, need their node_modules folder when deploying. It would suit me much more if I was just able to create a small gulpfile.js for each project, rather than 6000+ files contained in the node_modules folder for every project, that are only ever used by me on this machine.

I only use Gulp to compile SASS and prefix and minify my CSS. I don't need to worry about any other type of deployment issues, but the documentation says I need both: Global and local copies of Gulp.

解决方案

Gulp needs to be installed locally, but you can link the local install to a global install:

npm install --global gulp
npm link gulp

See also https://stackoverflow.com/a/30742196/451480

这篇关于我可以在全球范围内仅安装Gulp吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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