gpt4 book ai didi

node.js - Sass-loader 需要 node-sass >=4 即使存在

转载 作者:IT老高 更新时间:2023-10-28 23:07:03 25 4
gpt4 key购买 nike

我对 Angular 6 执行了更新。在 ng serve -o 期间,我收到 sass-loader 期望 node-sass 的错误。运行 ng serve -o 后,我收到:

ERROR in ./src/sass/styles.scss (./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/sass/styles.scss)
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (node_modules\sass-loader\lib\loader.js:31:19)
ERROR in ./src/app/app.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (node_modules\sass-loader\lib\loader.js:31:19)
ERROR in x.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (\node_modules\sass-loader\lib\loader.js:31:19)
ERROR in x.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (loader.js:31:19)
ERROR in .x.component.scss
Module build failed: Error: `sass-loader` requires `node-sass` >=4. Please install a compatible version.
at Object.sassLoader (node_modules\sass-loader\lib\loader.js:31:19)

显然,我检查了所有内容(在我看来),但我不知道发生了什么。

Package.Json:

"devDependencies": {
"@angular-devkit/build-angular": "~0.6.0",
"@angular/cli": "6.0.0",
"@angular/compiler-cli": "6.0.0",
"@angular/language-service": "6.0.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.106",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-html-detailed-reporter": "^1.1.21",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"karma-teamcity-reporter": "^1.1.0",
"phantomjs-prebuilt": "^2.1.16",
"protractor": "~5.1.2",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "2.7.2"
}

dir -l node_modules 说:

...
05/07/2018 08:53 AM <DIR> node-sass
...
05/07/2018 08:53 AM <DIR> sass-loader
...

我执行了:

npm rebuild node-sass 

和第二种方法:我删除了本地 Node 模块和 %User%\AppData\Roaming\npm-cache。然后我删除了锁定文件并执行了 npm

npm cache clear --force
npm install

但还是没有成功。

我错过了什么?

最佳答案

npm rebuild --force

也有帮助

关于node.js - Sass-loader 需要 node-sass >=4 即使存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50210311/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com