Angular 4项目中的node-sass问题

Issue with node-sass in angular 4 project

运行现有的Angular4应用程序时,我在MAC上遇到以下问题。 它显示了执行ng serve时出现的错误

ERROR in
./node_modules/css-loader?{"sourceMap":false,"import":false}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./node_modules/sass-loader/lib/loader.js?{"sourceMap":false,"precision":8,"includePaths":[]}!./node_modules/angular-calendar-week-hours-view/angular-calendar-week-hours-view.scss
Module build failed: Error: Cannot find module 'node-sass'

我在angular-cli.json中导入样式如下

1
2
3
"styles": [
       "../node_modules/angular-calendar-week-hours-view/angular-calendar-week-hours-view.scss"
      ],

可能是什么问题?

1
"styleExt":"scss",

在angular-cli.json中添加了styleExt作为scss。
我确实有节点9.11.1


最新的node.js版本存在问题。 安装较旧版本6.8.0的问题已解决

最新版本将错误抛出到npm install node-sass
在较低版本中效果很好。