Last updated: Feb 29, 2024
Reading timeยท3 min
2022.2.3
or more recentThe ESLint error "TypeError: this.libOptions.parse is not a function" occurs because the WebStorm ESLint plugin tries to access a function that has been removed in ESLint version 8.23.
There are 2 main ways to solve the error:
2022.2.3
or more recent. (recommended)8.22.0
.The WebStorm ESLint plugin tries to access a function that has been removed in
ESLint version 8.23
.
However, the function is available in ESLint version 8.22
.
If you'd rather downgrade your ESLint version than update WebStorm, open your terminal and issue the following command.
# with NPM npm install eslint@8.22.0 --save-exact --save-dev
If you use the yarn
package manager, issue the following command instead.
# with YARN yarn add eslint@8.22.0 --dev --exact
If you get an error when issuing the command, try to rerun it with the --force
flag.
npm install eslint@8.22.0 --force --save-exact --save-dev
The --save-exact
flag pins the version of the package in your package.json
file.
If you still weren't able to install version 8.22.0
, try to uninstall ESLint
and then install the specific version.
# with NPM npm uninstall eslint npm install eslint@8.22.0 --save-exact --save-dev
Here are the equivalent yarn commands.
yarn remove eslint yarn add eslint@8.22.0 --dev --exact
After you run the command, ESLint will be pinned to version 8.22.0
and the
issue should be resolved.
Try to restart your IDE and development server if the error persists.
You can also pin the version of eslint
by manually replacing its current
version in the devDependencies
object in your package.json
file.
{ "devDependencies": { "eslint": "8.22.0" } }
Make sure to run the npm install
or yarn install
command if you manually pin
your version.
# with NPM npm install # with YARN yarn install
If the error is not resolved, remove the node_modules
directory and reinstall
your dependencies.
Issue the following commands on Windows.
# ๐๏ธ (Windows) delete node_modules and package-lock.json rd /s /q "node_modules" del package-lock.json del -f yarn.lock # ๐๏ธ clean npm cache npm cache clean --force npm install
If you are on macOS or Linux, issue the following commands instead.
# ๐๏ธ (macOS/Linux) delete node_modules and package-lock.json rm -rf node_modules rm -f package-lock.json rm -f yarn.lock # ๐๏ธ clean npm cache npm cache clean --force npm install
Check if the error persists after pinning ESLint's version.
2022.2.3
or more recentA fix has been introduced in WebStorm version 2022.2.3
, so make sure your IDE
runs a version greater than or equal to 2022.2.3
.
You can check your IDE's version by clicking on Help in the top menu and selecting About.
If your version of WebStorm is older than 2022.2.3
, you have to update your
IDE.
You can follow the instructions on how to update WebStorm in this section of the docs.
For example, if you click on the cogwheel icon in the top right corner, you will likely get an option to update the IDE.
You can also click on Help in the top menu and then select Check for Updates.
A pop-up box will appear toward the bottom of the screen. Click on the Update... button.
Finally, click on the Update and Restart button.
If you have difficulties updating WebStorm to a version >= 2022.2.3
, follow
the instructions in
this section of the
official docs.