node.js 将 gulp 安装到 Windows 10

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33051213/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 19:22:20  来源:igfitidea点击:

Installing gulp to windows 10

node.jswindowsgulp

提问by user2301515

I've installed gulp

我已经安装了 gulp

npm install --global gulp

and set envidoment variable:

并设置环境变量:

 - variable: GULP_HOME
 - Value: C:\Users\myaccount\AppData\Roaming\npm\node_modules\gulp  (..\gulp is folder)

in environment variables And try to run "gulp". Then i get a message in cmd:

在环境变量中并尝试运行“gulp”。然后我在cmd中收到一条消息:

C:\myaccount\workspace\todoparrot>gulp
[09:47:24] Local gulp not found in C:\myaccount\workspace\todoparrot

How to set gulp to work?

如何设置 gulp 工作?

回答by fsf

You must locally install gulp to that folder. Use the following command:

您必须在本地将 gulp 安装到该文件夹​​。使用以下命令:

npm install gulp

if it is not fixed, try to install it globally:

如果未修复,请尝试全局安装:

npm install gulp-cli -g

回答by cs123

I installed gulp globally, then used the link command to link the current directory to the global installation. I used the command -

我全局安装了gulp,然后使用link命令将当前目录链接到全局安装。我使用了命令 -

npm link gulp

npm 链接吞咽