在./src/style es.scss中出错。模块构建失败:错误:找不到模块'node-sass' [英] ERROR in ./src/styles.scss .. Module build failed: Error: Cannot find module 'node-sass'

查看:9
本文介绍了在./src/style es.scss中出错。模块构建失败:错误:找不到模块'node-sass'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在新计算机上执行NPM启动时,出现以下错误:

    Time: 18322ms
chunk {main} main.js, main.js.map (main) 487 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 227 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.22 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 430 kB  [rendered]
chunk {styles} styles.js, styles.js.map (styles) 282 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 6.32 MB [initial] [rendered]

ERROR in ./src/styles.scss (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/styles.scss)
Module build failed: Error: Cannot find module 'node-sass'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.sassLoader (C:...(path)...
ode_modulessass-loaderlibloader.js:24:22)
i 「wdm」: Failed to compile.

我的Angular.json

...
 "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.css",
              "node_modules/font-awesome/css/font-awesome.css",
              "node_modules/animate.css/animate.min.css",
              "src/styles.scss",
              "node_modules/ngx-toastr/toastr.css",
              "node_modules/alertify.js/dist/css/alertify.css"
            ],
...
我的节点版本: V8.11.3 角度5+

推荐答案

如错误所示Error: Cannot find module 'node-sass'。要解决此问题,您必须使用以下命令安装node-sass:

npm install node-sass

这篇关于在./src/style es.scss中出错。模块构建失败:错误:找不到模块'node-sass'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆