Module build failed: Error: ENOENT: no such file or directory, scandir 'D:\...\n

2,735 阅读1分钟

Module build failed: Error: ENOENT: no such file or directory, scandir 'D:\Commu nity\D4Mobile\node_modules\node-sass\vendor'

这种情况遇到过很多次,每次都是没有头绪。今天发现如下操作可以让程序正常运行。

1.cd 进入node_modules
$ cd node_modules

2.运行npm rebuild node-sass
$ npm rebuild node-sass

最后直接运行代码就OK了