Babel transpilation problem

I setup file warch with Babel to produce ES5 code from my ES6 fle as describe here:
http://blog.jetbrains.com/webstorm/2015/05/ecmascript-6-in-webstorm-transpiling/

But I get the following error every time I edit my ES6 file:


/home/siva/Applications/node-v4.2.1-linux-x86/bin/babel --source-maps --out-file test-compiled.js /home/siva/Workspace2/working2/test.js
/home/siva/Applications/node-v4.2.1-linux-x86/bin/babel: 3: /home/siva/Applications/node-v4.2.1-linux-x86/bin/babel: Syntax error: word unexpected (expecting ")")


Process finished with exit code 2

5 comments
Comment actions Permalink

Such errors usually mean that the shell can't execute the script. What shell do you use?
Do you have executable permissions for /home/siva/Applications/node-v4.2.1-linux-x86/bin/babel?

see also http://kb.froglogic.com/pages/viewpage.action?pageId=4915282

0
Comment actions Permalink

I am using Bash on Ubuntu. The permissions seems OK for me.

shell.png

0
Comment actions Permalink

what does this script look like? Does it begin with a shebang line?

0
Comment actions Permalink

First please accept my thanks.

After you questioned about the contents of the script, I looked into that, and the contents is as follows:

#!/bin/sh


console.error("The CLI has been moved into the package `babel-cli`.");
console.log();
console.log("$ npm install -g babel-cli");
console.log();
process.exit(1);


Now I used npm install -g babel-cli and the problem is solved.

Thanks again.

0
Comment actions Permalink

#!/bin/sh was the problem. And, indeed, npm install -g babel-cli is the best solution

0

Please sign in to leave a comment.