elifTech / cpd-ocpp

Open Charge Point Protocol
https://www.eliftech.com/blog/48-a-diy-charging-point-for-an-electric-car-perspective-protocol-and-prototype
MIT License
64 stars 49 forks source link

[PI branch] Unexpected token import #3

Open goRaspy opened 6 years ago

goRaspy commented 6 years ago

Hi,

I tried to deploy your (awesome) proof of concept on a Pi 3 with raspian but when I run npm start I get a problem with the js import method.

Please let me know how to solve this issue.

Many thanks

SyntaxError: Unexpected token import at new Script (vm.js:51:7) at createScript (vm.js:136:10) at Object.runInThisContext (vm.js:197:10) at Module._compile (internal/modules/cjs/loader.js:618:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10) at Module.load (internal/modules/cjs/loader.js:566:32) at tryModuleLoad (internal/modules/cjs/loader.js:506:12) at Function.Module._load (internal/modules/cjs/loader.js:498:3) at Function.Module.runMain (internal/modules/cjs/loader.js:695:10) at startup (internal/bootstrap/node.js:201:19)

mrbig commented 4 years ago

@goRaspy you should use at least nodejs 12, and run with the --experimental-modules flag.

Also some of the examples seem to be outdated.