Running BabelJS on Windows
Kobkrit Viriyayudhakorn, Ph.D. CEO of iApp Technology Limited.
[email protected] http://www.kobkrit.com
How to try ES6 and Beyond with on Windows
(1) Open Command Line with “Run as Administrator”
(2) Create Directory at C:\es6 and then run “npm init”
(3) Press Enter Many Times Until All Questions are Answered
(4) npm install --save-dev babel-cli babel-preset-stage-0
(5) Type “doskey babel-node=.\node_modules\.bin\babel-node $*” and hit file > save
(6) Go back to command line, type “link.cmd”
(7) echo {"presets":["stage-0"]} > .babelrc
(9) Type down some ES6 code, e.g., console.log(‘Hello World!’); + Hit Save
Alias is not persistence!• If you closed the command line windows, enter c:
\es6 again, and always run link.cmd
• Open command line program
• cd c:\es6
• link.cmd
• babel-node somefile.js