0

I am trying to test the Microsoft BotBUilder samples with the Bot Framework Emulator. I have cloned the BotBuilder repo and gone through the readme instructions npm install but when I run npm start I get this error

/home/ronald/Desktop/botbuilder-samples/samples/javascript_nodejs/02.echo-bot/node_modules/csv-parse/lib/index.js:20
    super({...{readableObjectMode: true}, ...opts})
           ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:53:10)
    at Object.runInThisContext (vm.js:95:10)
    at Module._compile (module.js:543:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/ronald/Desktop/botbuilder-samples/samples/javascript_nodejs/02.echo-bot/node_modules/csv/lib/index.js:6:10)

npm ERR! Linux 4.15.0-72-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v7.10.1
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node ./index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'node ./index.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the echobot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./index.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs echobot
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls echobot
npm ERR! There is likely additional logging output above.

4
  • what's your node --version result ? Look like JS don't understand deconstructing ... Commented Dec 10, 2019 at 16:30
  • Because this works fine: let opts = {foo:'bar'}; console.log({...{readableObjectMode: true}, ...opts}); > {readableObjectMode: true, foo: "bar"} Commented Dec 10, 2019 at 16:31
  • node --version gives me v7.10.1 Commented Dec 10, 2019 at 16:32
  • 1
    Posted as answer: BotBuilder need 10.14+ Commented Dec 10, 2019 at 16:34

2 Answers 2

1

Your running it on Nodejs version 7+ and BotBuilder require 10.14+.

So your node is not able to understand deconstructing operator ....

Try to upgrade your node and it'll works fine.

Sign up to request clarification or add additional context in comments.

Comments

1

Can you please try:

super({readableObjectMode: true, ...opts})

I don't think you need to spread the first object.

6 Comments

I get the same error. super({{readableObjectMode: true}, ...opts}) ^ SyntaxError: Unexpected token {
The code you pasted back to me, isn't the code I sent you as an example. You've added a {} around the readableObjectMode ? Remove it so its just this: super({readableObjectMode: true, ...opts}) which is what I sent to you in the answer :)
Whoops you're right, I've still got the error though ``` super({ readableObjectMode: true, ...opts }) ^^^ SyntaxError: Unexpected token ... ```
Please read - stackoverflow.com/help/minimal-reproducible-example - If you could provide us your code, we'll have a much better chance of helping you
It's not the best way to do it but it should works fine.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.