1

I am trying to convert my nodejs application into an .exe file. I am stuck with the canvas module(npm install @tensorflow/tfjs canvas). For some reason,nw.js is not able to load this module.

This is the line for which I am getting the error :

const canvas = require("canvas");

And this is the error :

enter image description here

I did go through this but unfortunately it didn't help. My node version is : 16.10.10 and nw.js version is : 0.57.1. Using Windows10.

Is there any way in which this can be solved ? Thanks.

S M
  • 111
  • 11

2 Answers2

0

It's my understanding that anything using nw-gyp won't work with newer version of node because of the difference in supported Python versions. Somebody needs to get nw-gyp ported to work with Python 3.

One related thread: edge-js build failing with nw-gyp

sysrage
  • 594
  • 4
  • 6
0

I was not able to solve the above error where I was using node webkit, hence I switched to pkg, and it worked.

pkg is CLI that allows you to package or bundle your node.js project into an executable file. The generated executed file can be run on devices which do not have nodejs installed.

More info about pkg can be found here.

S M
  • 111
  • 11