Pull a project from github, and after npm install, you often encounter this problem when starting npm run dev
Cannot find module '...模块名...'
Go into the corresponding module dependency package and see that they are all soft link directories, and the soft link directory is an invalid directory and does not have the corresponding resource package, that is, it is not installed.
Ask the master, how can npm install also install the contents in the soft link directory when installing dependencies?
npm The network speed is too slow, and incomplete installation is common.
It is recommended to switch to cnpm
It’s simple:
After that, just use cnpm install <module-name> to install it.
The command is just npm->cnpm, nothing else remains the same.
Super fast
I have been working on a project for such a long time and have never encountered this kind of problem. You can try using cnpm i
Delete
C:UsersusernameAppDataRoamingnpm
重新执行npm install
Delete the originally installed package and reinstall