Module not found: Error: Can’t resolve ‘XXX’ in ‘XXXX’

故障

控制台运行webpack/npm时出现

1
Module not found: Error: Can't resolve 'XXX' in 'XXXX'

解决方案

1
npm i XXX --save

重新运行即可
如果提示ERROR
尝试执行

1
2
npm uninstall XXX
npm i XXX --save