Unexpected token )
I just installed this package using npm install -g sql-cli and when I run mssql I get this:
/path/to/.nvm/versions/node/v6.11.5/lib/node_modules/sql-cli/node_modules/password-prompt/index.js:106
)
^
SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at /Users/aldo/.nvm/versions/node/v6.11.5/lib/node_modules/sql-cli/lib/options.js:9:22
Have the same issue. Worked fine in October 2017, now it's not working. Tried installing 0.6.1 instead, but no luck.
EDIT: It's a password-prompt issue, the have a working fix currently waiting to be merged into master: https://github.com/jdxcode/password-prompt/issues/2
I had the same issue, looks like there was an extra comma in line 105.
I was able to fix it by editing the file:
/usr/local/lib/node_modules/sql-cli/node_modules/password-prompt/index.js
And changing line 105 from
options,
To
options
I am getting the similar issue:
/usr/local/lib/node_modules/sql-cli/node_modules/password-prompt/index.js:8 mask: (ask, options = {}) => read.raw(ask, true, options), ^
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 /usr/local/lib/node_modules/sql-cli/lib/options.js:9:22
at Object.
Managed to get it working by removing the following = {} in lines 7,8,9 and 102.