Nodejs-storage: SyntaxError: Unexpected } catch {}

Created on 21 Aug 2020  路  3Comments  路  Source: googleapis/nodejs-storage

391

Environment details

  • OS: OSX
  • Node.js version: v12.14.1
  • npm version: 6.13.4
  • @google-cloud/storage version: ^5.1.1
  • npm package installed on meteor 1.8.1

Steps to reproduce

  1. ? npm install @google-cloud/storage
  2. ? start app (running inside meteor)

logs

W20200821-10:38:31.710(2)? (STDERR) /Users/dfrankes/Documents/GitHub/portaal/node_modules/@google-cloud/storage/node_modules/p-limit/index.js:30
W20200821-10:38:31.711(2)? (STDERR) } catch {}
W20200821-10:38:31.711(2)? (STDERR) ^
W20200821-10:38:31.711(2)? (STDERR)
W20200821-10:38:31.712(2)? (STDERR) SyntaxError: Unexpected token {
W20200821-10:38:31.712(2)? (STDERR) at createScript (vm.js:80:10)
W20200821-10:38:31.712(2)? (STDERR) at Object.runInThisContext (vm.js:139:10)
W20200821-10:38:31.712(2)? (STDERR) at Module._compile (module.js:617:28)
W20200821-10:38:31.713(2)? (STDERR) at Object.Module._extensions..js (module.js:664:10)
W20200821-10:38:31.713(2)? (STDERR) at Module.load (module.js:566:32)
W20200821-10:38:31.713(2)? (STDERR) at tryModuleLoad (module.js:506:12)
W20200821-10:38:31.713(2)? (STDERR) at Function.Module._load (module.js:498:3)
W20200821-10:38:31.713(2)? (STDERR) at Module.require (module.js:597:17)
W20200821-10:38:31.714(2)? (STDERR) at require (internal/module.js:11:18)
W20200821-10:38:31.714(2)? (STDERR) at Object. (/Users/dfrankes/Documents/GitHub/portaal/node_modules/@google-cloud/storage/build/src/bucket.js:25:16)
W20200821-10:38:31.714(2)? (STDERR) at Module._compile (module.js:653:30)
W20200821-10:38:31.714(2)? (STDERR) at Object.Module._extensions..js (module.js:664:10)
W20200821-10:38:31.714(2)? (STDERR) at Module.load (module.js:566:32)
W20200821-10:38:31.715(2)? (STDERR) at tryModuleLoad (module.js:506:12)
W20200821-10:38:31.715(2)? (STDERR) at Function.Module._load (module.js:498:3)
W20200821-10:38:31.715(2)? (STDERR) at Module.require (module.js:597:17)

More info

If i change the file myself (in the node_modules folder and change catch {} to cache (e) {} the app runs fine.

storage question

Most helpful comment

It Seems this error is due to older version of nodeJS, try upgrading to nodeJS 12, catch{} is supported.

All 3 comments

Maybe this is an issue with Meteor? https://github.com/sindresorhus/p-limit/issues/33

It Seems this error is due to older version of nodeJS, try upgrading to nodeJS 12, catch{} is supported.

It Seems this error is due to older version of nodeJS, try upgrading to nodeJS 12, catch{} is supported.

Thank you @Yatanvesh ! I was stuck on this error for a while upgrading and downgrading Terser, TWP, and others and after updating Docker image node version to 12.0.0 it resolved the error for me. Cheers.

Was this page helpful?
0 / 5 - 0 ratings