Friday 26 April 2019

How to get node.js code working in an electron app?

Hello,I'm a complete beginner with javascript, node, and electron, however I'm making an app using these, and part of the app involves me using the yelp api. To do this, I have to include the lineconst yelp = require('yelp-fusion'); And the rest of the code is querying the api and printing the results. When I run this code directly through node, it works fine, however when I add this file to my electron project, which is used by an html file, I get the error:Uncaught Error: Module name "yelp-fusion" has not been loaded yet for context: _. Use require([])I tried following the instructions at https://requirejs.org/docs/errors.html#notloaded but i was unable to solve the issue, and to be honest I'm not understanding why this is an issue, since node has no problems with it. Perhaps I am just using electron incorrectly?

Submitted April 27, 2019 at 04:54AM by brett96

No comments:

Post a Comment