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?
天蓬老师2017-05-16 13:40:13
npm The network speed is too slow, and incomplete installation is common.
It is recommended to switch to cnpm
It’s simple:
npm install -g cnpm --registry=https://registry.npm.taobao.org
After that, just use cnpm install <module-name> to install it.
The command is just npm->cnpm, nothing else remains the same.
Super fast
phpcn_u15822017-05-16 13:40:13
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