Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.
2023-09-11 14:16:34 时间
错误:Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid 'reference' directive syntax.
E:\web-project\angulardemo>npm run start
> angulardemo@0.0.0 start E:\web-project\angulardemo
> ng serve
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
** NG Live Development Server is running on http://localhost:4200. **
10% building modules 6/6 modules 0 active(node:13196) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
(Use `node --trace-deprecation ...` to show where the warning was created)
Hash: 77bf3ed9d657b78ba2d8
Time: 6707ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 248 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.map (main) 4.01 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 9.71 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.64 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
ERROR in E:/web-project/angulardemo/node_modules/@types/node/index.d.ts (20,1): Invalid 'reference' directive syntax.
webpack: Failed to compile.
解决:E:\web-project\angulardemo\node_modules\@types\node\index.d.ts 去掉3个\\\斜杆修改成 2个斜杠如下面:
// Type definitions for Node.js 6.14
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
// DefinitelyTyped <https://github.com/DefinitelyTyped>
// Wilco Bakker <https://github.com/WilcoBakker>
// Thomas Bouldin <https://github.com/inlined>
// Sebastian Silbermann <https://github.com/eps1lon>
// Alorel <https://github.com/Alorel>
// Hoàng Văn Khải <https://github.com/KSXGitHub>
// Sander Koenders <https://github.com/Archcry>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// NOTE: These definitions support NodeJS and TypeScript 3.2 and above.
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
// Reference required types from the default lib:
// <reference lib="es2015" />
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
// <reference path="base.d.ts" />
// TypeScript 3.2-specific augmentations:
修改完再次运行:
E:\web-project\angulardemo>npm run start
> angulardemo@0.0.0 start E:\web-project\angulardemo
> ng serve
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
** NG Live Development Server is running on http://localhost:4200. **
10% building modules 6/6 modules 0 active(node:13168) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
(Use `node --trace-deprecation ...` to show where the warning was created)
Hash: 77bf3ed9d657b78ba2d8
Time: 6129ms
chunk {0} polyfills.bundle.js, polyfills.bundle.map (polyfills) 248 kB {4} [initial] [rendered]
chunk {1} main.bundle.js, main.bundle.map (main) 4.01 kB {3} [initial] [rendered]
chunk {2} styles.bundle.js, styles.bundle.map (styles) 9.71 kB {4} [initial] [rendered]
chunk {3} vendor.bundle.js, vendor.bundle.map (vendor) 2.64 MB [initial] [rendered]
chunk {4} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
相关文章
- [Angular 8] Custom Route Preloading with ngx-quicklink and Angular
- [Angular] New in V6.1
- [Angular] USING ZONES IN ANGULAR FOR BETTER PERFORMANCE
- [Angular 2] Injecting a Service
- [Angular 2] Validation
- [Angular 2] ng-control & ng-control-group
- [Angular 2] NgNonBindable
- [Angular 2] Passing data to components with 'properties'
- [Angular] In angular world and out angular world
- [Angular] Using useExisting provider
- [Angular] Wrap a third party lib into service
- [Angular Directive] 1. Write an Angular Directive
- [Angular2 Form] Use RxJS Streams with Angular 2 Forms
- Angular 项目里 angular.json 文件内容的学习笔记
- 如何使用 Visual Studio Code 调试 Angular Schematics 实现
- Angular SSR 应用的 SEO 实现一个例子 - meta 和 title 元素的赋值
- Angular 项目里 angular.json 文件内容的学习笔记
- Angular双向绑定的一个例子
- AngularJS 1.x 国际化——Angular-translate例子