Search code examples
node.jsraspberry-piraspberry-pi3nwjs

Unexpected token ILLEGAL (ELF) Raspberry Pi Node Webkit Linux v0.31.3


I downloaded the sdk executable from dl.nwjs.io/v031.3, tried 32 and 64 bit version for Linux.

I try to run these on a raspberry pi 3b+, with node Desktop/nwjs-sdk-v0.31.3-linux-x64/nw

get this error:

(function (exports, require, module, __filename, __dirname) { ?ELF???

SyntaxError: Invalid or unexpected token
 at new Script 
....... at startup (internal/bootstrap/node.js:240:19)

Note I am running the code straight from nwjs.io, not copying any whitespace characters in from stackoverflow or other sources like somerelated questions suggest.


Solution

  • The reason why it is not working is because you are trying to run NW.js compiled for x86 (and x64) platforms but Raspberry Pi uses ARM architecture.

    You can find a NW.js binary that will work in all Raspberry Pi versions out of the box here: https://github.com/jalbam/nwjs_rpi