Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

报错处理之 -- 关于node-sass里面 vendor 缺失 #38

Open
deepthan opened this issue Feb 26, 2018 · 4 comments
Open

报错处理之 -- 关于node-sass里面 vendor 缺失 #38

deepthan opened this issue Feb 26, 2018 · 4 comments

Comments

@deepthan
Copy link
Owner

ERROR in ./node_modules/css-loader?{"sourceMap":false,"importLoaders":1}!./node_modules/postcss-loader?{"ident":"postcss"}!./node_modules/@angular/cli/node_modules/sass-loader/lib/loader.js?{
"sourceMap":false,"precision":8,"includePaths":[]}!./src/styles.scss
Module build failed: Error: ENOENT: no such file or directory, scandir 'D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\vendor'
    at Object.fs.readdirSync (fs.js:913:18)
    at Object.getInstalledBinaries (D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\lib\extensions.js:128:13)
    at foundBinariesList (D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\lib\errors.js:20:15)
    at foundBinaries (D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\lib\errors.js:15:5)
    at Object.module.exports.missingBinary (D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\lib\errors.js:45:5)
    at module.exports (D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\lib\binding.js:15:30)
    at Object.<anonymous> (D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\sass-loader\lib\loader.js:3:14)
    at Module._compile (module.js:571:32)
 @ ./src/styles.scss 4:14-213
 @ multi ./src/styles.scss
  • 法一 : 找到缺失的文件直接下载

首先看开头的错误信息,

  1. ERROR in...在什么地方报错了,
  2. Module build failed后面跟的是模块打包错误原因及地址,
  3. no such file or directory, scandir 'D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\vendor',在D:\个人\gitee-poetry\node_modules\@angular\cli\node_modules\node-sass\vendor'中vendor文件不存在。

那么我们找到这个文件位置,从node-sass官网下载一个vendor文件放进去即可。

  • 法二 : 重新构建 node-sass
npm rebuild node-sass

或者删除 node_modules 重新下载

@deepthan deepthan changed the title 报错处理之 -- 关于 vendor 缺失 报错处理之 -- 关于node-sass里面 vendor 缺失 Feb 26, 2018
@xinpengfei520
Copy link

Thank you very much!

@NameWjp
Copy link

NameWjp commented Aug 28, 2020

good

@xiaoyaoting
Copy link

thanks

1 similar comment
@shaoqiang6
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants