ModuleBuildError: Module build failed: Error: ENOENT: no such file or directo

2021-10-16  乐帮网

webpack nodejs

遇到以下错误:

ERROR in ./static/sass/element-variables.scss
Module build failed: ModuleBuildError: Module build failed: Error: ENOENT: no such file or directo
    at Object.readdirSync (node:fs:1390:3)
    at Object.getInstalledBinaries (E:\code\bak\TachographsApp\node_modules\node-sass\lib\extensio
    at foundBinariesList (E:\code\bak\TachographsApp\node_modules\node-sass\lib\errors.js:20:15)
    at foundBinaries (E:\code\bak\TachographsApp\node_modules\node-sass\lib\errors.js:15:5)
    at Object.module.exports.missingBinary (E:\code\bak\TachographsApp\node_modules\node-sass\lib\
    at module.exports (E:\code\bak\TachographsApp\node_modules\node-sass\lib\binding.js:15:30)
    at Object.<anonymous> (E:\code\bak\TachographsApp\node_modules\node-sass\lib\index.js:13:35)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at getDefaultSassImpl (E:\code\bak\TachographsApp\node_modules\sass-loader\dist\index.js:198:1
    at Object.loader (E:\code\bak\TachographsApp\node_modules\sass-loader\dist\index.js:80:29)
    at E:\code\bak\TachographsApp\node_modules\webpack\lib\NormalModule.js:195:19
    at E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at runSyncOrAsync (E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunner.js:1
    at iterateNormalLoaders (E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunne
    at Array.<anonymous> (E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunner.j
    at Storage.finished (E:\code\bak\TachographsApp\node_modules\enhanced-resolve\lib\CachedInputF
    at E:\code\bak\TachographsApp\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:77:9
    at E:\code\bak\TachographsApp\node_modules\graceful-fs\graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
 @ ./src/main.js 45:0-47

ERROR in ./static/sass/element-variables.scss
Module build failed: ModuleBuildError: Module build failed: Error: ENOENT: no such file or directo
    at Object.readdirSync (node:fs:1390:3)
    at Object.getInstalledBinaries (E:\code\bak\TachographsApp\node_modules\node-sass\lib\extensio
    at foundBinariesList (E:\code\bak\TachographsApp\node_modules\node-sass\lib\errors.js:20:15)
    at foundBinaries (E:\code\bak\TachographsApp\node_modules\node-sass\lib\errors.js:15:5)
    at Object.module.exports.missingBinary (E:\code\bak\TachographsApp\node_modules\node-sass\lib\
    at module.exports (E:\code\bak\TachographsApp\node_modules\node-sass\lib\binding.js:15:30)
    at Object.<anonymous> (E:\code\bak\TachographsApp\node_modules\node-sass\lib\index.js:13:35)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at getDefaultSassImpl (E:\code\bak\TachographsApp\node_modules\sass-loader\dist\index.js:198:1
    at Object.loader (E:\code\bak\TachographsApp\node_modules\sass-loader\dist\index.js:80:29)
    at E:\code\bak\TachographsApp\node_modules\webpack\lib\NormalModule.js:195:19
    at E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunner.js:233:18
    at runSyncOrAsync (E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunner.js:1
    at E:\code\bak\TachographsApp\node_modules\loader-runner\lib\LoaderRunner.js:205:4
    at E:\code\bak\TachographsApp\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:70:14
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
 @ ./static/sass/element-variables.scss
 @ ./src/main.js

执行如下操作:

 node node_modules/node-sass/scripts/install.js  

npm install

解决这一个坑还有另一个坑等着呢。

 

 

公众号二维码

关注我的微信公众号
在公众号里留言交流
投稿邮箱:1052839972@qq.com

庭院深深深几许?杨柳堆烟,帘幕无重数。
玉勒雕鞍游冶处,楼高不见章台路。
雨横风狂三月暮。门掩黄昏,无计留春住。
泪眼问花花不语,乱红飞过秋千去。

欧阳修

付款二维码

如果感觉对您有帮助
欢迎向作者提供捐赠
这将是创作的最大动力