[Fix] TypeError: this.libOptions.parse is not a function

Recently I just started using the Next.js on WebStorm 2022.2.1 Build #WS-222.3739.57 and created the new Next.js project. Sudden it is showing the below error TypeError: this.libOptions.parse is not a function.

TypeError: this.libOptions.parse is not a function

 TypeError: this.libOptions.parse is not a function error is seen because of the recent changes introduced in eslint@8.23.0 version code.

Issue has been filed on official website to ESLint developers and tracked as WEB-57089 bug id. As per developer team, use the ESLint 8.22.0 version untill the issue is fixed into version 8.23.0.

There is nothing much you can do from your end to fix the issue TypeError: this.libOptions.parse is not a function except waiting till developer team release the new code version to fix the issue.

However, as a temporary fix, downgrade the ESLint to ESLint 8.22.0 version using command ‘rm -rf node_modules’, ‘rm package-lock.json’ and ‘run the Next.js project again, it would fix the ESLint: TypeError: this.libOptions.parse is not a function error.

However, as a temporary fix, downgrade the ESLint to ESLint 8.22.0 version using command ‘rm -rf node_modules’, ‘rm package-lock.json’ and ‘npm install eslint@8.22.0 –save-exact’. Run the Next.js project again using command ‘npm install’, it would fix the TypeError: this.libOptions.parse is not a function error.

Steps to fix error TypeError: this.libOptions.parse is not a function:

Solution 1: Downgrade ESLint to 8.22.0 Version

Step 1: delete node_modules

Use the below command to delete node_modules:

rm -rf node_modules

Step 2: Delete package-lock.json

Use the below command to delete package-lock.json

rm package-lock.json

Step 3: Install ESLint 8.22.0 Version

Use the below command to install ESLint 8.22.0 version:

npm install eslint@8.22.0 --save-exact

Step 4: Run ‘npm install’ command

npm install

Or Run a single below mentioned command for all required changes:

rm -rf node_modules; rm package-lock.json; npm install

Solution 2: Change Manual ESLint Configuration

Instead of following the above procedure, you can manually change the Manual ESLint Configuration as targeting ESLint package in global scope configuration.

Change Manual ESLint Configuration for TypeError: this.libOptions.parse is not a function

Now error TypeError: this.libOptions.parse is not a function would be fixed for you.