Closed giangchau92 closed 4 years ago
related: https://github.com/sylvainpolletvillard/ObjectModel/issues/126
ObjectModel v4 is using ES Module exports, so you need a Node.js version that supports ES Modules, that is >= 13.2.0
https://medium.com/@nodejs/announcing-core-node-js-support-for-ecmascript-modules-c5d6dc29b663
The other option, if you do not want to update your Node.js version, is to retrieve a CommonJS or UMD version of the lib. You can either build it yourself or take an existing one, for example Pika CDN provides one here: https://cdn.pika.dev/objectmodel/%5E4.2.2
Thanks for your reply. I could run my script now.
I have pulled and make a node test project but it was not worked. What do I miss? Error: export { Any, ArrayModel, BasicModel, FunctionModel, MapModel, Model, ObjectModel, SetModel }; ^^^^^^
SyntaxError: Unexpected token 'export' at Module._compile (internal/modules/cjs/loader.js:892:18) at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10) at Module.load (internal/modules/cjs/loader.js:812:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:849:19) at require (internal/modules/cjs/helpers.js:74:18)