I am using https://github.com/mllrsohn/grunt-node-webkit-builder to package my node-webkit app which is built using AngularJS.

The app works fine on MAC when I build from Sublime Text. But when I package the app using any packaging tool, I get the error saying "require is not defined". What am I missing?

For more context, I have a services layer which is written in Node.js using express. The Angular project calls Node.js APIs and renders the content. I am using a SQLite3 DB. Which is the best way to package such apps? I am alright with writing an installer starts Node.js server separately.

有帮助吗?

解决方案

You'll always get a "require is not defined" error if you don't use a node-webkit environement for developpement in Windows. You can use nodebob for developpement environement : You have to put your html files into nodebob\buildTools\nw and then run nw.exe Just reload it after your changes

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top