I downloaded nodejs (v6.3.0 Current) from https://nodejs.org/en/ and installed it. I also installed the nodejs plugin in phpstorm

enter image description here

In the settings of the storm Settings β†’ Languages ​​& Frameworks β†’ Node.js and NPM - I can watch these settings

enter image description here

Next, in the phpStorm terminal phpStorm I type the command

 npm install --save-dev babel 

And I see the node_modules folder in my project, which has babel.js

enter image description here

I also observe that in the settings Settings β†’ Languages ​​& Frameworks β†’ Node.js β†’ the babel package has been added

In the Npm packgage storm settings, I change the path from C:\Program Files\nodejs\node_modules\npm to myProjectDir/node_modules (in my case it’s D:\!work\!WEBServers\OpenServer\domains\dev.test.ru\node_modules ) .
Why? Yes, I do not know why. Apparently because there is now this very Babel ...

Next, create a js file with simple code:

 let foo = () => console.log('test'); foo(); 

and trying to add a watcher

enter image description here

But when I change something in the file - the storm gives me an error

An exception occurred while executing watcher 'Babel'. Watcher has been disabled. Fix it .: Cannot run program "D:! Work! WEBServers \ OpenServer \ domains \ dev.test.ru \ node_modules \ .bin \ babel" (in directory "D:! Work! WEBServers \ OpenServer \ domains \ dev.test .ru \ src "): CreateProcess error = 193,% 1 is not a Win32 application


What am I doing wrong? And where should I click to make it good?

How the hell do you want it, install correctly both node and babel and other extensions like gulp, grunt and others into the project. And how to add observers? How?

Video already watched with instructions. The dude puts the babel and even the console has the babel something command available ... I don't have :-(

And I read other instructions - it’s not working, so don’t send me to Google)

  • 1. D:! Work! WEBServers \ OpenServer \ domains \ dev.test.ru \ node_modules.bin \ babel - before .bin should be \ 2. try to run babel in the console, directly, specify the absolute path "D:! Work! WEBServers \ OpenServer \ domains \ dev.test.ru \ node_modules \ .bin \ babel "without parameters - Robert Dampilon
  • @RobertDampilon 1. I had a slash .. just ruSO something shielded in my question, not good, but I did not notice ......... what settings I just did not try .. and by default - writes the error is higher and with macros - writes An exception occurred while executing watcher 'Babel'. Watcher has been disabled. Fix it.: Invalid executable An exception occurred while executing watcher 'Babel'. Watcher has been disabled. Fix it.: Invalid executable An exception occurred while executing watcher 'Babel'. Watcher has been disabled. Fix it.: Invalid executable ......... In general, if you specify the "scripts": { "watch":"babel src -d out --presets es2015 -w" } setting in package.json "scripts": { "watch":"babel src -d out --presets es2015 -w" } and on just in the terminal phpstrorm type npm run watch - then everything works like a clock ...... and here is the brain of the storm. - Alexey Shimanskyj

1 answer 1

A casket just opened.

In English, SO recommended:

try babel.cmd instead of just babel .

I tried it and it worked. Everything is so simple> _ <


In general, my settings are as follows:

Program - D:!work!WEBServers\OpenServer\domains\dev.test.ru\node_modules\.bin\babel (or $FileParentDir$\node_modules\.bin\babel.cmd if through a macro)

Arguments - --presets es2015 $FileDir$/test.js --out-file $FileParentDir$/out/test.js

Working directory - $FileParentDir$\src

enter image description here


Or the Arguments field for yesterday, so that he watches the whole folder instead of a single file:

 --presets es2015 $FileDir$ -d $FileParentDir$/out 

Apparently with gulp and other devilish offspring will also have to do)