未找到本地 gulp(尝试运行:npm install gulp) [英] Local gulp not found (Try running: npm install gulp)

查看:62
本文介绍了未找到本地 gulp(尝试运行:npm install gulp)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个具有以下定义的模块(webapp-module-storage):

I created a module (webapp-module-storage) which has the following definitions:

package.json

{
  "dependencies": {
    ...
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    ...
  },
  "name": "webapp-module-storage",
  "scripts": {
    "postinstall": "gulp build",
    "test": "gulp test"
  }
}

我认为在安装时可以在另一个模块中使用我的模块:

I thought I can use my module inside another module when installing it with:

  • npm install github:myorg/webapp-module-storage#master

但是,当我安装我的模块时,我收到了这个错误:

However, when I install my module, I am getting this error:

找不到本地 gulp

尝试运行:npm install gulp

Try running: npm install gulp

截图

我的理解是,gulp 与我的模块一起提供,因为我在 devDependencies 中声明了它,但看起来我的 npm postinstall脚本找不到 gulp.

My understanding is, that gulp is shipped together with my module because I declared it in devDependencies but it looks like that my npm postinstall script cannot find gulp.

我错过了什么吗?

推荐答案

尝试在您的应用程序目录中运行 npm link gulp(以创建到全局安装的 Gulp 模块的本地链接).

Try running npm link gulp in your application directory (to create a local link to the globally installed Gulp module).

这篇关于未找到本地 gulp(尝试运行:npm install gulp)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆