strongloop / loopback-component-storage

Storage component for LoopBack.
Other
130 stars 155 forks source link

v3.4.0 Cannot load connector loopback-component-storage: SyntaxError: Unexpected token #249

Closed josephlaw closed 6 years ago

josephlaw commented 6 years ago

Description/Steps to reproduce

Upgraded from 3.3.1 to 3.4.0.

Then got below error when start loopback server:

loopback:datasource Settings: {"name":"storage","connector":"loopback-component-storage","provider":"filesystem","root":"./server/storage","maxFileSize":"2097152","debug":true} +7ms loopback:datasource Module ./connectors/loopback-component-storage not found, will try another candidate. +1ms loopback:datasource Module loopback-connector-loopback-component-storage not found, will try another candidate. +0ms loopback:datasource Cannot load connector loopback-component-storage: SyntaxError: Unexpected token ... at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:373:25) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/server/node_modules/loopback-component-storage/index.js:7:10) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) +8ms

Link to reproduction sandbox

Expected result

Additional information

dhmlau commented 6 years ago

@josephlaw , what's the node version you're using?

josephlaw commented 6 years ago

@dhmlau , v4.8.2 and v4.8.4, thanks

virkt25 commented 6 years ago

Can you please try updating the version of Node you are using to 6 or higher as Node 4 is out of LTS and 3.4.0 dropped support for it. Alternatively you can pin the version to 3.3.x but I would advise against that as you may miss out on important security fixes in dependencies / Node itself.

josephlaw commented 6 years ago

Already fallback to 3.3

dhmlau commented 6 years ago

@josephlaw , as @virkt25 mentioned, Node 4 is already end of LTS. We'd recommend to upgrade the Node version to 6 or above. Thanks.

dhmlau commented 6 years ago

As a result, I'm closing this ticket. @josephlaw, if you encounter any issue when using Node 6+, please feel free to reopen this ticket or open a new one.