How to install and use babel and watchers in phpstorm on windows?

I downloaded nodejs (v6.3.0 Current) from https://nodejs.org/en/ and installed it.

I also installed the plugin nodejsin PhpStorm.

enter image description here

In my settings -> Languages ​​& Frameworks -> Node.js and NPM I can see its settings

enter image description here

In the PhpStorm terminal, I enter the command:

npm install --save-dev babel

I see node_moduleswith babel.jsin my project

enter image description here

I also see this in Settings -> Languages ​​& Frameworks -> Node.js -> packages

Now I am changing the Npm package path from C:\Program Files\nodejs\node_modules\npmto myProjectDir/node_modules(in my case, this D:\!work\!WEBServers\OpenServer\domains\dev.test.ru\node_modules). I don’t know why .. Do I need to do this?

I am creating a file jswith code:

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

and trying to add an observer

enter image description here

But when I try to change something in the file - PhpStorm gives me an error:

"" . . .: "D:! Work! WEBServers\OpenServer\domains\dev.test.ru\ node_modules \. Bin\babel" ( "D:! Work! WEBServers\OpenServer\domains\dev.test.ru\" ): CreateProcess = 193,% 1 win32


? node, babel (gulp, grunt ..) ? ?

+4
1

@LazyOne : babel.cmd babel.

, .

> _ <


, :

- D:!work!WEBServers\OpenServer\domains\dev.test.ru\node_modules\.bin\babel ( $FileParentDir$\node_modules\.bin\babel.cmd )

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

- $FileParentDir$\src

enter image description here


Arguments watcher :

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

Source: https://habr.com/ru/post/1648540/


All Articles