LoginSignup
4
2

More than 3 years have passed since last update.

gulpインストール後にgulp: command not foundのエラー

Last updated at Posted at 2020-04-20

エラー内容

$ gulp ejs
bash: gulp: command not found
$ sudo npm install -g gulp
Password:
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
/Users/mac/.npm-global/bin/gulp -> /Users/mac/.npm-global/lib/node_modules/gulp/bin/gulp.js
+ gulp@4.0.2
updated 2 packages in 9.078s
'/Users/mac/.npm-global/bin/gulp'

ココに着目。

対処法

/Users/mac/.npm-global/bin に path が通っていない事が原因でした。

$ export PATH=/Users/mac/.npm-global/bin:$PATH
$ gulp ejs
[10:53:38] Using gulpfile ~/Desktop/work/02-ejs/gulpfile.js
[10:53:38] Starting 'ejs'...
[10:53:38] Finished 'ejs' after 13 ms

OK!!

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2