Javascript 角度4中style.scss的网页包sass加载错误

Javascript 角度4中style.scss的网页包sass加载错误,javascript,angular,webpack,sass,platform-server,Javascript,Angular,Webpack,Sass,Platform Server,我正在尝试使用平台服务器渲染将postcss loader添加到Angular 4中,我不断得到如下错误,基本上我正在尝试将style.scs作为全局SCS添加到我的网页包进程中,类似于它在cli中的工作方式 ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader/lib?{}!./~/sass-loader/lib/loader.js!./src/styles.scss

我正在尝试使用平台服务器渲染将postcss loader添加到Angular 4中,我不断得到如下错误,基本上我正在尝试将style.scs作为全局SCS添加到我的网页包进程中,类似于它在cli中的工作方式

 ERROR in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader/lib?{}!./~/sass-loader/lib/loader.js!./src/styles.scss
        Module build failed: Error: No PostCSS Config found in: /Users/alireza.dezfoolian/Desktop/Angular 4/web-app/src
            at /Users/alireza.dezfoolian/Desktop/Angular 4/web-app/node_modules/postcss-load-config/index.js:51:26

只需使用sass加载程序

{
    test: /\.scss$/,
    use: ['to-string-loader', 'css-loader', 'sass-loader']
}

我认为您需要将节点sas添加到项目中。要安装节点sass,需要全局安装节点gyp

我也面临这个问题,这是因为node-sass包。因此,有必要重建节点sass包

运行cmd:
npm rebuild node sass
以确保其就绪

请参阅下面我的ubuntu终端的代码片段:


我的问题得到解决

我这样做了,但仍然得到了这个错误
asus@asus:~/Documents/demo$ npm rebuild node-sass                            

> node-sass@4.5.3 install /home/asus/Documents/demo/node_modules/node-sass   
> node scripts/install.js                                                    

Cached binary found at /home/asus/.npm/node-sass/4.5.3/linux-x64-48_binding.n
ode                                                                          

> node-sass@4.5.3 postinstall /home/asus/Documents/demo/node_modules/node-sas
s                                                                            
> node scripts/build.js                                                      

Binary found at /home/asus/Documents/demo/node_modules/node-sass/vendor/linux
-x64-48/binding.node                                                         
Testing binary                                                               
Binary is fine                                                               
node-sass@4.5.3 /home/asus/Documents/demo/node_modules/node-sass