neutralinojs / neutralinojs-cli

neu cli for Neutralinojs
https://neutralino.js.org/docs/cli/neu-cli
MIT License
91 stars 57 forks source link

Unexpected token revisited #183

Closed jobtraklite closed 2 years ago

jobtraklite commented 2 years ago

I tried to create an app with

neu create logon

and got

**/usr/local/lib/node_modules/@neutralinojs/neu/src/utils.js:42 return path?.replace(/^\//, '');

Unexpected token**


Linux kernal: 5.4.0-122-generic GNOME terminal version: 3.36.2 node.js version: v10.19.0 npm version: 6.14.4

A response to a similar query stated that the cause was an outdated node.js; so I ran

$ sudo apt install nodejs

at the terminal and got

nodejs is already the newest version (10.19.0~dfsg-3ubuntu1)

So what do I do now?

Thank you Paul Marlin

jobtraklite commented 2 years ago

I got the same error message when I ran

neu version

I re-ran

npm i -g @neutralinojs/neu

and got

**/usr/local/bin/neu -> /usr/local/lib/node_modules/@neutralinojs/neu/bin/neu.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/@neutralinojs/neu/node_modules/chokidar/node_modules/fsevents):

npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm WARN notsup Unsupported engine for set-value@4.1.0: wanted: {"node":">=11.0"} (current: {"node":"10.19.0","npm":"6.14.4"})

npm WARN notsup Not compatible with your version of node/npm: set-value@4.1.0

updated 1 package in 6.688s **

So it appears I didn't install neutralinojs successfully.

Paul Marlin

kodaloid commented 2 years ago

Hi there, it appears you have an old version of node running which uses a version the V8 engine that is not compatible with Neutralino CLI. The command you used to install it picked the latest supported by the distribution, so you need to do some things in the terminal to solve the problem.

There are several ways to update node on Linux, personally I like to use https://www.npmjs.com/package/n

Good luck!

jobtraklite commented 2 years ago

That seems to have solved the problem. Thanks