我在运行现有的Angular4应用程序时面临MAC问题 . 它显示执行 ng serve
时出现此错误
错误在./node_modules/css-loader?{"sourceMap":false,"import":false}!!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false} !./ node_modules / SASS装载机/ LIB / loader.js { “sourceMap”:假, “精确”:8中, “的includepaths”:[]}?!./ node_modules /角日历周小时视图/ angular-calendar-week-hours-view.scss模块构建失败:错误:找不到模块'node-sass'
我在angular-cli.json中导入样式如下
"styles": [
"../node_modules/angular-calendar-week-hours-view/angular-calendar-week-hours-view.scss"
],
可能的问题是什么?
"styleExt": "scss",
在angular-cli.json中添加了styleExt作为scss . 我有节点9.11.1
1 回答
最新的node.js版本存在问题 . 安装旧版本6.8.0解决了问题
最新版本抛出错误
npm install node-sass
它在较低版本中效果很好 .