ESLint in WebStorm - webstorm

Has anybody encountered the problem ESLint not loading in WebStorm? I'm trying to specify a path /usr/local/bin/eslint, /usr/local/bin,
Every time I got this message:
or no such directory message.

You need to point that field to the actual ESLint script. This would usually be the place where you've installed the ESLint npm package or command-line tool.

OS X El Capitan
I've installed npm & node with brew. It's easy to keep stuff up to date with brew.
brew install node
then installed eslint globally with npm
npm i eslint -g
and here is my working config:
/usr/local/bin/node /usr/local/lib/node_modules/eslint
I add .eslintrc file with eslint rules in project's root folder.
Try using those drop-downs next to input field, webstorm gives path w/o any typing.

Following are the steps you need to get it working on Windows 10:
Open command prompt and navigate to your project root.
Run the following command:
npm install eslint --save-dev
Once ESLint finishes installing in the above step, navigate through the following menus in Webstorm:
File > Settings.... Click on Settings...
In the Settings screen that shows up, in the top-left hand corner, there is a Search box. Type eslint in it.
That will show you the 'ESLint' settings for this project. Now tick the checkbox that says "Enable". Make sure that the Node interpreter: has the right value. In my case, it was C:\Program Files\nodejs\node.exe
Just below the Node interpreter: setting, there is a setting called ESLint package:. If you have correctly installed the ESLint package as I mentioned in Step 2 above, this setting will be auto-populated to show the current path of ESLint package from your project's node_modules folder. In my case, the value of this setting was:
D:\www\gdp\node_modules\eslint (gdp is my project root folder)
Click on Apply and OK buttons respectively.
Restart Webstorm. If you have successfully completed all the steps, you will not see the prompt to enter the ESLint again.
Enjoy!!!

Related

How to set up pnpm in run/debug in WebStorm

I get the error for "Please specify npm or yarn package: cannot find binary file inside" after I try to set up the path of pnpm under Preferences -> Languages & Frameworks -> Node.js and NPM -> Package Management. From WebStorm doc, that is how I should set up.
Does anyone know how to use pnpm in WebStorm?
I solved the problem by installing, node and npm then pnpm as global under my Mac that I do not have before.
brew install node
npm i -g pnpm#x.x.x make sure x.x.x version matched the version of my project
Then go to use /usr/local/pin/pnpm under "Preferences" -> "Languages & Frameworks" -> "Node.js and NPM" -> "Package Management"
and under "Run/Debug Configuration" select the Project for Package Management not the directory of pnpm under my project. I guess for somereason Webstorm can not use pnpm under my project

Can't add WSL Node Interpreter to WebStorm

I need to add WSL node interpreter to WebStorm (2020.1) but Linux distribution is not detected by WebStorm, even though I have Alpine WSL install through Windows Store.
I read this question, but no help. Also manually adding entry in wsl.distributions.xml didn't work, did a lot of research but nothing worked.
I was able to use WSL as terminal in WebStorm by adding wsl.exe location to shell path. My objective is to run npm scripts form from Run/Debug configuration.
I solved by reinstalling WebStorm and copying options folder
from C:\Users\me\AppData\Roaming\JetBrains\WebStorm2020.1
to C:\Users\me\AppData\Local\JetBrains\WebStorm2020.1, then WebStorm could detect Linux distribution installed on machine.
But, now when I am trying to run scripts from NPM Tool Window of WebStorm, WebStorm runs C:\Windows\System32\wsl.exe run "/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run start --scripts-prepend-node-path=auto" where run is redundant coming after C:\Windows\System32\wsl.exe ...
How can I set WebStorm to not have run in wsl.exe run ...?

Unable to install arcpy module using Pycharm

I realize this has come up before, but all the responses I've found were for different versions of Arc.
I have followed the steps from this link and set my project interpreter to python c:\Python27\ArcGIS10.4\python.exe. Based from what i've read, that should be set up with Arcpy pre-installed. However, if I look at the packages in the VENV, arcpy isn't listed. I've tried adding it using pip and the pycharm GUI package manager. There isn't a package just named arcpy, the options are:
arcpy-metadata
arcpy-virtualenv
arcpyext
arcpylogger
I have successfully installed all of them and they show up in the package list of the project virtual environment. Despite this, I still get "no module named arcpy" as an error when I go to run a script.
Any ideas about where i'm going wrong?
Thanks for your help.
So I've spent a while looking over the issue and using Conda as your project Interpreter is the fix to your issue. I've tested it myself as well. Here are some clear instructions on how to correctly install Conda and set up the environment in Pycharm:
To create a Conda environment:
Ensure that Anaconda or Miniconda is downloaded and installed on your computer, and you're aware of a path to its executable file.
(Refer to the installation instructions for more details.)
Press Meta+Comma to open the project Settings/Preferences.
In the Settings/Preferences dialog Meta+Comma, select Project | Project Interpreter. Click the The Configure project interpreter icon and select Add.
In the left-hand pane of the Add Python Interpreter dialog, select Conda Environment.
The following actions depend on whether the Conda environment existed before.
If New environment is selected:
Specify the location of the new Conda environment in the text field, or click Conda environment location and find location in your file system. Note that the directory where the new Conda environment should be located, must be empty!
Select the Python version from the list.
Specify the location of the Conda executable file in the text field, or click Conda executable location and find location in the Conda installation directory. You're basically looking for a path that you've used when installing Conda on your machine.
Select the Make available to all projects checkbox, if needed.
If Existing environment is selected:
Expand the Interpreter list and select any of the existing interpreters. Alternatively, click Select an interpreter and specify a path to the Conda executable in your file system, for example, C:\Users\jetbrains\Anaconda3\python.exe.
Select the checkbox Make available to all projects, if needed.
Click OK to complete the task.

Environment variable issue in build an apk in ionic project

I am trying to build an apk in ionic 2 but while building is getting following error.
Error:
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
After that, I set the environment variable and path. Even though still am getting that error again can anyone please help me how to solve this issue
Instruction 1:
After adding your ANDROID_HOME, make sure you do the below:
Restart your System or run source ~/.bash_profile
Remove Android platform from your project ionic cordova platform rm android or ionic platform rm android
Add Android platform ionic cordova platform add android
Then ionic cordova run android or ionic run android
Instruction 2:
To set your ANDROID_HOME and JAVA_HOME, follow the below steps:
Run command open ~/.bash_profile
Paste the below in the file that opens on your Text editor
export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Save - "Command S" or "Ctrl S"
Then Follow the "Instruction 1:" above
NOTE: Make sure you have 24.4.1_1 SDK
Hope this helps.

webstorm IDE: program path not specified when running JS script how can I fix this?

I'm trying to run my JavaScript script, however the message keeps on giving me an error saying:
Configuration is still incorrect. Do you want to edit it again?
Is there a way to fix this?
I had a similar error and it was because I did not specify my path to where I installed node.js. In webstorm, go to File -> Settings -> Language&Frameworks -> Node.js and NPM and in the Node interpreter text box, point it to the path of where node.js was installed. For me it was at C:\Program Files (x86)\nodejs.
If you didn't install node.js and npm, you need to do so.
If you are trying to debug js code and you are using a chrome browser, you need to install their extension and use "Inspect in WebStorm" action.
Found the above behavior occurs with the WebStorm project folder within the OneDrive path (Windows 10). As shown in the image of the run configuration, WebStorm shows and error for location of the path to the JavaScript file even though it is correct. Click Run > Continue from here and it executes with node.js as expected. Move the project to a folder outside of the OneDrive path and the error is gone.
Image: Webstorm Run Configuration Error in OneDrive