I am just trying to get started with node-webkit however when I try to use require() I get the error [60904:0624/190000:INFO:CONSOLE(92)] "Uncaught AssertionError: missing path", source: assert.js (92). I am starting up node-webkit with the following command ./node-webkit.app/Contents/MacOS/node-webkit . My package.json looks like this
{
"name" : "nw-subset",
"main" : "Subset.html",
"window" : {
"toolbar" : true,
"frame" : true
}
}
I have tried just running require('os') and window.require('os') and both give me the same error.
I encountered a similar error. For me, the issue was that I also had ace.js loaded, which also assigns a global require function.
To solve this, you can add the following code snippet: (source)
<script type="text/javascript">
window.requireNode = window.require;
window.require = undefined;
</script>
in the head of your main html file. Then just use requireNode instead of require.