Can I install just Gulp globally?

2019-04-04 03:08发布

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.

1条回答
Root(大扎)
2楼-- · 2019-04-04 03:53

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

查看更多
登录 后发表回答