Angular工程启动时报错,错误信息如下:
D:\project\gold\webchat\manager>ng serve --open
Your global Angular CLI version (7.0.6) is greater than your local
version (1.6.7). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
11% building modules 16/26 modules 10 active ...rver\client\index.js?hDate: 2018-12-13T04:14:53.214Z
Hash: e5d6f461f2e95585c959
Time: 22521ms
chunk {authentication.module} authentication.module.chunk.js () 104 kB [rendered]
chunk {base.module} base.module.chunk.js () 737 kB [rendered]
chunk {business.module} business.module.chunk.js () 1.03 MB [rendered]
chunk {common} common.chunk.js (common) 1.16 MB [rendered]
chunk {dashboard.module} dashboard.module.chunk.js () 5.64 MB [rendered]
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 196 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 1.11 MB [initial] [rendered]
chunk {scripts} scripts.bundle.js (scripts) 328 kB [initial] [rendered]
chunk {statistic.module} statistic.module.chunk.js () 29.9 kB [rendered]
chunk {styles} styles.bundle.js (styles) 848 kB [initial] [rendered]
chunk {system.module} system.module.chunk.js () 856 kB [rendered]
chunk {vendor} vendor.bundle.js (vendor) 15.9 MB [initial] [rendered]
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":[]}!./src/assets/scss/style.scss
Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2
at module.exports (D:\project\gold\webchat\manager\node_modules\node-sass\lib\binding.js:13:13)
at Object.
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
@ ./src/assets/scss/style.scss 4:14-208
@ multi ./src/styles.css ./node_modules/angular-calendar/css/angular-calendar.css ./node_modules/chartist/dist/chartist.css ./node_modules/ng2-toastr/bundles/ng2-toastr.min.css ./node_modules/quill/dist/quill.snow.css ./node_modules/dragula/dist/dragula.css ./src/assets/scss/style.scss ./node_modules/primeicons/primeicons.css ./node_modules/primeng/resources/themes/nova-light/theme.css ./node_modules/primeng/resources/primeng.min.css
ERROR in ./src/app/layouts/full/full.component.scss
Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.7.2
at module.exports (D:\project\gold\webchat\manager\node_modules\node-sass\lib\binding.js:13:13)
at Object.
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
@ ./src/app/layouts/full/full.component.ts 37:21-53
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://0.0.0.0:0 ./src/main.ts
webpack: Failed to compile.
^C终止批处理操作吗(Y/N)? y
解决办法:
运行命令:npm uninstall --save node-sass卸载旧版本node-sass,
运行命令:npm install --save node-sass,安装新版本node-sass,
如下所示:
D:\project\gold\webchat\manager>npm uninstall --save node-sass
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@^4.0.0 but none is installed. You must install peer dependencies yourself.
up to date in 14.706s
D:\project\gold\webchat\manager>npm install --save node-sass
> [email protected] install D:\project\gold\webchat\manager\node_modules\node-sass
> node scripts/install.js
Downloading binary from https://npm.taobao.org/mirrors/node-sass/v4.11.0/win32-x64-64_binding.node
Download complete..] - :
Binary saved to D:\project\gold\webchat\manager\node_modules\node-sass\vendor\win32-x64-64\binding.node
Caching binary to C:\Users\lenovo\AppData\Roaming\npm-cache\node-sass\4.11.0\win32-x64-64_binding.node
> [email protected] postinstall D:\project\gold\webchat\manager\node_modules\node-sass
> node scripts/build.js
Binary found at D:\project\gold\webchat\manager\node_modules\node-sass\vendor\win32-x64-64\binding.node
Testing binary
Binary is fine
npm WARN @angular/[email protected] requires a peer of @angular/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of popper.js@^1.14.3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@^4.0.0 but none is installed. You must install peer dependencies yourself.
+ [email protected]
added 44 packages from 50 contributors, removed 3 packages and updated 13 packages in 23.677s
D:\project\gold\webchat\manager>ng serve --open
Your global Angular CLI version (7.0.6) is greater than your local
version (1.6.7). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
11% building modules 15/26 modules 11 active ...rver\client\index.js?hDate: 2018-12-13T04:18:20.099Z
Hash: 9ff6e83114cb2ae41ffc
Time: 25409ms
chunk {authentication.module} authentication.module.chunk.js () 104 kB [rendered]
chunk {base.module} base.module.chunk.js () 737 kB [rendered]
chunk {business.module} business.module.chunk.js () 1.03 MB [rendered]
chunk {common} common.chunk.js (common) 1.16 MB [rendered]
chunk {dashboard.module} dashboard.module.chunk.js () 5.64 MB [rendered]
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 196 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 1.11 MB [initial] [rendered]
chunk {scripts} scripts.bundle.js (scripts) 328 kB [initial] [rendered]
chunk {statistic.module} statistic.module.chunk.js () 29.9 kB [rendered]
chunk {styles} styles.bundle.js (styles) 2.57 MB [initial] [rendered]
chunk {system.module} system.module.chunk.js () 856 kB [rendered]
chunk {vendor} vendor.bundle.js (vendor) 15.9 MB [initial] [rendered]
webpack: Compiled successfully.