亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

node.js - I only want to install gulp locally on mac, how to run the gulp command?
PHPz
PHPz 2017-06-07 09:24:20
0
7
1667

I only want to install gulp locally on mac, how to run the gulp command

PHPz
PHPz

學(xué)習(xí)是最好的投資!

reply all(7)
我想大聲告訴你

npm script

Add

gulpscript to `scripts` of package.json

  "scripts": {
    "gulp": "gulp"
  }
npm run gulp -- --version

The disadvantage of this method is that it can only be run under the current project

Environment variables

Find the gulp installation directory <gulp-install-dir>, and then add the directory <gulp-install-dir>/node_modules/.bin to the environment variable

三叔

I don’t quite understand your question. I only want to install it locally. Does it mean that gulp is not included when deployed to the server?

淡淡煙草味

Using npm run can solve this problem.
Or when executing gulp in the current directory, writing ./gulp can also solve the problem.

I don’t understand the reason for not installing gulp globally.

過去多啦不再A夢

Run it directly under your project

./node_modules/.bin/gulp

It is recommended to install it globally or use npm script as other answerers said

// package.json

{
  "devDependencies": {
    "gulp": "^3.9.1"
  },
  "scripts": {
    "start": "gulp"
  }
}

Run

npm start
女神的閨蜜愛上我

You cannot use the gulp command directly in the terminal without sudo to install gulp globally.

Alternatively, you can write "gulp": "gulp xxx" in the npm script of package.json to use npm run gulp to run the gulp installed in the project

為情所困

npm run ‘xx’ way. Don't run gulp directly.

我想大聲告訴你

Don’t want to install it globally, but want to use gulp in the command line?

Try npm link ?

https://docs.npmjs.com/cli/link
http://javascript.ruanyifeng....
https://github.com/atian25/bl...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template