如何解决构建我的角度应用程序时发生的错误?

时间:2019-01-24 17:26:05

标签: node.js angular npm sass

在构建我的角度应用程序时,在sass-loader上出现错误。

我尝试更新sass-loader依赖项,但是没有用。

有人可以帮助我吗?

所有信息下方

操作系统:Windows Server 2016内部版本14393

Angular版本:(ng --version)

Angular CLI: 7.1.4
Node: 11.7.0
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.11.4
@angular-devkit/core         7.1.4
@angular-devkit/schematics   7.1.4
@schematics/angular          7.1.4
@schematics/update           0.11.4
rxjs                         6.3.3
typescript                   3.1.6

节点版本: v11.7.0

NPM版本: 6.5.0

堆栈错误:

ERROR in ./src/styles.scss
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (67)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.9.3
    at module.exports (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.sassLoader (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\sass-loader\lib\loader.js:46:72)
    at runLoaders (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\webpack\lib\NormalModule.js:286:20)
    at C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:364:11
    at C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:230:18
    at runSyncOrAsync (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:143:3)
    at iterateNormalLoaders (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:229:2)
    at C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:202:4
    at VirtualFileSystemDecorator.readFile (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\@ngtools\webpack\src\virtual_file_system_decorator.js:38:13)
    at processResource (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:199:11)
    at iteratePitchingLoaders (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:158:10)
    at iteratePitchingLoaders (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
    at C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:173:18
    at loadLoader (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\loadLoader.js:36:3)
    at iteratePitchingLoaders (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
    at iteratePitchingLoaders (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
    at C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\LoaderRunner.js:173:18
    at loadLoader (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\loader-runner\lib\loadLoader.js:36:3)
ERROR in Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (67)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.9.3
    at module.exports (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\node-sass\lib\binding.js:13:13)
    at Object.<anonymous> (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:721:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)
    at Module.require (internal/modules/cjs/loader.js:657:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.sassLoader (C:\WebService\mipaaf\mipaaf-fe-2\node_modules\sass-loader\lib\loader.js:46:72)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mipaaf-fe@0.0.0 build: `ng build --prod`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mipaaf-fe@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\admin.daniele.isoni\AppData\Roaming\npm-cache\_logs\2019-01-24T16_52_35_999Z-debug.log

1 个答案:

答案 0 :(得分:2)

我想将此添加为评论,但积分不足。 您是否尝试过npm rebuild node-sass?我之前有这个错误,并已解决了这个问题