简体   繁体   English

即使安装了npm install -g gulp,也没有找到本地gulp安装

[英]No local gulp install found even after installing npm install -g gulp

I tried to install gulp by 我试着安装gulp

npm install -g gulp

The output seems to be something like this. 输出似乎是这样的。 (i have skipped some logs) (我跳过了一些日志)

npm http 304 https://registry.npmjs.org/string_decoder
npm http 304 https://registry.npmjs.org/lodash._htmlescapes
/usr/bin/gulp -> /usr/lib/node_modules/gulp/bin/gulp.js
gulp@3.6.2 /usr/lib/node_modules/gulp
├── tildify@0.2.0
├── pretty-hrtime@0.2.1
├── deprecated@0.0.1
├── archy@0.0.2
├── semver@2.2.1
├── chalk@0.4.0 (has-color@0.1.7, ansi-styles@1.0.0, strip-ansi@0.1.1)
├── orchestrator@0.3.3 (sequencify@0.0.7)
├── liftoff@0.9.8 (extend@1.2.1, minimist@0.0.8, resolve@0.6.3, findup-sync@0.1.3)
├── vinyl-fs@0.1.4 (graceful-fs@2.0.3, map-stream@0.1.0, mkdirp@0.3.5, vinyl@0.2.3, glob-stream@3.1.9, glob-watcher@0.0.6)
└── gulp-util@2.2.14 (lodash._reinterpolate@2.4.1, dateformat@1.0.7-1.2.3, minimist@0.0.8, vinyl@0.2.3, multipipe@0.0.2, through2@0.4.1, lodash.template@2.4.1)

In the above script i can see a line /usr/bin/gulp -> /usr/lib/node_modules/gulp/bin/gulp.js which i guess is making a simulink in bin folder. 在上面的脚本中,我可以看到一行/ usr / bin / gulp - > /usr/lib/node_modules/gulp/bin/gulp.js,我想这是在bin文件夹中进行simulink。 So i should be getting gulp globally but i get the this error. 所以我应该在全球范围内获得gulp但是我得到了这个错误。

No local gulp install found in /var/www/ksapp

Any idea why i am getting this error. 知道为什么我得到这个错误。

Thanks 谢谢

正如文档中所指出的 ,您应该全局安装它(您这样做) 并将其添加到您的项目开发站(本地):

npm install gulp --save-dev

I faced the same issue. 我遇到了同样的问题。 Got it resolved by creating a link 通过创建链接解决了问题

npm link gulp

Check /home/username/.npm directory: maybe groups/owner of files is root. 检查/home/username/.npm目录:也许文件的组/所有者是root。 Change to username: 更改为用户名:

chown -R username.username /home/username/.npm

I've recently run into the "Local gulp not found" error message. 我最近遇到了“找不到Local gulp”错误消息。 I was able to work past it by creating a symlink from the global node_modules directory to the local project directory where my gulpfile.js is located. 我能够通过创建一个从全局node_modules目录到我的gulpfile.js所在的本地项目目录的符号链接来解决它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM