Failed to load plugin jsdoc: Cannot find module ‘eslint-plugin-jsdoc‘

In the egg project, NPM is installed for the first time   The following errors are reported when the package is:

Oops! Something went wrong! :(

ESLint: 5.16.0.
ESLint couldn't find the plugin "eslint-plugin-jsdoc". This can happen for a couple different reasons:

1. If ESLint is installed globally, then make sure eslint-plugin-jsdoc is also installed globally. A globally-installed ESLint cannot find a locally-installed plugin.

2. If ESLint is installed locally, then it's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

     npm i eslint-plugin-jsdoc@latest --save-dev

Path to ESLint package: /Users/***/node_modules/eslint

If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.

The eslint does not work normally, and when the file does not comply with the eslint rules, an error is reported in the console log as follows:

Failed to load plugin jsdoc: Cannot find module 'eslint-plugin-jsdoc'....

reason:

When NPM v8.0 installed the project dependency, it did not correctly install the project dependency (eslint config egg) dependency (eslint plugin JSDoc)

solve:

After upgrading NPM to v8.1.2, delete the node in the project_ Modules and package-lock.json, and then reinstall

rm -rf node_modules
rm package-lock.json
npm i

Supplement:

If you have the same error, you can search globally   Eslint plugin JSDoc to locate dependencies with NPM command

➜  *** git:(master) ✗ npm ls eslint-plugin-jsdoc
***@1.0.0 /Users/***
└─┬ [email protected]
  └── [email protected]

Then determine whether to install or upgrade NPM manually or for other reasons.

Read More: