Hi, I cannot set up my PhpStorm IDE to work with Java Script files to work in a console. I do not know why it is NOT showing! Maybe because it is PhpStorm, not WebStorm which I presume has no problem with the console and the js files...
Whenever I am tring to debug the JavaScript file in the project it gives me ONLY one option - to see it in the web browser and debug the HTML file - not the js file itself!
I had the same problem with php storm. Here's how I solved it:
1. First you will need to install NodeJS in order to work properly with js files in PHP storm; Download and install it on your PC from here: https://nodejs.org/en/
2. (OPTIONAL) You will need to check node js version in cmd by typing node -v it will show you the ltest version of NODE JS
3. Configure PHP storm IDE to work properly with NodeJS:
- Create a new JavaScript file in which to write your code (TO TEST IT)
- Starting to write our code you can see that the "let" statement is marked as incorrect - this happens because you haven’t set up the Language Level of our project to EcmaScript 6 (EcmaScript 6 is the reason why you need NODE JS(and not only) for phpstrom)
- Setup the Default Settings for PHPbstorm, so that all projects start with them by default. Go to >> Default Settings >> Languages & Frameworks >> JavaScript and choose JavaScript language version to ECMAScript 6 >> Select Prefer Strict mode (SEE THE PICTURE BELLOW!)
- You may need to repeat this process for the current Settings as well
- If you want to test our code locally with Node (the console we are talking about), you need to add an extra line to call the function you just wrote with some sample input and then choose Run from the Right-Click menu.
4. Watch the video below to see clearly how it is done. It is in some foreign language - but you can mute it and just watch the first 70-80 seconds: