NPM error reporting series


This article is to record all NPM related error messages encountered in the work. If you encounter new problems, you will continue to update.

1,unable to resolve dependency tree

Cannot resolve dependency tree.
Cause: may be dependency conflict.
Solution: NPM install — save XXX — legacy peer DEPs
This problem occurred during installation vue-i18n.

Fix upstream dependency conflicts, or use — force or–legacypeerdepsRetry the command to accept incorrect (and possibly corrupt) dependency resolution
–Legacy peer DEPs: ignore all peer dependencies during installation and adopt the style of NPM version 4 to 6
–Force: NPM forces a module to be reinstalled whether it has been installed or not. You can use – f or — force parameters

You can also see a website explaining legacy peer DEPs:What did NPM install XXXX — legacy peer DEPs do?

2. NPM run dev displays eperm: operation not allowed

No permission.
Reason: I don’t know.
Solution: in vscode, restart a new terminal and execute NPM run dev again. Success.

The above error occurs when NPM run dev is re executed after pulling the remote code and resolving the conflict.
Online solutions:
1. Because of the permission problem, open the command line as an administrator and restart. It didn’t work here.
2. The npmrc file needs to be deleted due to cache problems.
Stress: it is not the npmrc file under the NPM module in the nodejs installation directory
Instead, the. Npmrc file under C: \ users {account} \
This file does not exist locally…
3. The file and process are occupied. It runs in the PHP environment of docker. Nginx and PHP FPM are in docker. Solution: stop nginx in docker and re execute NPM run dev. after execution, start and start docker.

Finally, my solution:
In vscode, delete the original terminal, restart the new terminal, and execute NPM run dev again. Success.
Reference link:
Process occupied
File occupied
No allowed due to cache problem
Permission issues