gpt4 book ai didi

node.js - Node-Webkit 和 AngularJS 包应用程序 : require not defined

转载 作者:搜寻专家 更新时间:2023-10-31 23:54:54 24 4
gpt4 key购买 nike

我正在使用 https://github.com/mllrsohn/grunt-node-webkit-builder打包我使用 AngularJS 构建的 node-webkit 应用程序。

当我 build from Sublime Text 时,该应用程序在 MAC 上运行良好.但是当我使用任何打包工具打包应用程序时,我收到错误消息“require is not defined”。我错过了什么?

有关更多上下文,我有一个服务层,它是使用 express 在 Node.js 中编写的。 Angular 项目调用 Node.js API 并呈现内容。我正在使用 SQLite3 数据库。打包此类应用程序的最佳方式是什么?我可以编写一个单独启动 Node.js 服务器的安装程序。

最佳答案

如果您不在 Windows 中使用 node-webkit 环境进行开发,您将始终收到“require is not defined”错误。您可以使用 nodebob发展环境:你必须把你的 html 文件放到 nodebob\buildTools\nw 然后运行 ​​nw.exe更改后重新加载即可

关于node.js - Node-Webkit 和 AngularJS 包应用程序 : require not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23557423/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com