在 Brunch 应用程序中使用 npm 模块会导致“找不到模块" [英] Using a npm module in a Brunch app results in "module not found"

查看:77
本文介绍了在 Brunch 应用程序中使用 npm 模块会导致“找不到模块"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用这个节点库:https://github.com/sudhirj/simply-推迟

我跑了:

npm install simply-deferred

并将其添加到依赖项下的 package.json 中.

And added it to package.json under dependencies.

"simply-deferred": "*"

安装成功:

> require ("simply-deferred")
{ Deferred: [Function],
  when: [Function],
  installInto: [Function] }

但它没有添加到 vendor.js 中,当我运行 require("simply-defered") 时,它说找不到模块(即使我手动将 js 文件添加到/vendors).

But it is not added to vendor.js, and when I run require("simply-defered"), it says module not found (even when I manually added the js file to /vendors).

我是一个 npm/node 初学者.

I am a npm/node beginner.

推荐答案

您不能在早午餐应用中要求 NPM 模块.来自网站:

You cannot require NPM modules in brunch app. From the site:

Brunch 是一个 HTML5 应用程序汇编器

Brunch is a HTML5 application assembler

npm 是 node.js 包管理器.Brunch 是 HTML5 应用程序构建器.不同的东西.

npm is node.js package manager. Brunch is HTML5 app builder. Different stuff.

这篇关于在 Brunch 应用程序中使用 npm 模块会导致“找不到模块"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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