将电子与 Angular2、Typescript 和 Electron 结合使用,我试图了解如何使用通过 npm 安装的节点模块包。当前的问题是我必须指定模块的位置,例如var module = require('./node_modules/xyz/lib/xyz.js')
. 但是随后electron并没有找到xyz的依赖关系,这些依赖关系位于内部./node_modules/xyz/node_modules/yyy
并且抱怨./yyy.js
找不到。
电子应用程序结构
dist
├── angular2.dev.js
├── config.js
├── index.html
├── main.js
├── node_modules
├── package.json
└── app.js