Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.

简介: Angular启动/node_modules/@types/node/index.d.ts (20,1): Invalid ‘reference‘ directive syntax.

错误: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.

 


相关文章
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
1176 1
|
存储 缓存 资源调度
深入浅出Node.js中的node_modules(二)
深入浅出Node.js中的node_modules
|
开发者 Java 存储
JSF 与 CDI 携手共进,紧跟技术热点,激发开发者情感共鸣,开启高效开发新征程
【8月更文挑战第31天】JavaServer Faces (JSF) 与 Contexts and Dependency Injection (CDI) 在 Java EE 领域中紧密协作,助力开发者高效构建现代 Web 应用。JSF 凭借其丰富的组件库和页面导航功能受到青睐,而 CDI 则优雅地管理对象生命周期并实现依赖注入。两者结合,不仅简化了复杂企业应用的开发,还实现了松耦合架构,增强了代码的灵活性、可维护性和可扩展性。通过示例展示了如何利用 CDI 将业务服务对象注入 JSF Managed Bean,以及如何在不同页面间共享数据,突显了这一组合的强大功能。
151 0
|
存储 JavaScript 数据库
如何使用 Socket.IO、Angular 和 Node.js 创建实时应用程序
如何使用 Socket.IO、Angular 和 Node.js 创建实时应用程序
148 0
Electron——node_modules\ffi-napi\build\Release\ffi_bindings.node is not a valid Win32 application.
Electron——node_modules\ffi-napi\build\Release\ffi_bindings.node is not a valid Win32 application.
255 0
|
开发工具 git
vscode设置 git提交代码忽略node_modules,dist,vscode如何设置不提交node_modules,dist
vscode设置 git提交代码忽略node_modules,dist,vscode如何设置不提交node_modules,dist
2506 0
LabVIEW使用VI服务器的调用节点将数据传递到另一个VI 使用调用节点(Invoke Node)与通过引用调用节点(Call by Reference)调用VI时有什么差别?
LabVIEW使用VI服务器的调用节点将数据传递到另一个VI 使用调用节点(Invoke Node)与通过引用调用节点(Call by Reference)调用VI时有什么差别?
623 0
|
存储 资源调度 JavaScript
深入浅出Node.js中的node_modules(三)
深入浅出Node.js中的node_modules
|
资源调度 JavaScript API
深入浅出Node.js中的node_modules(一)
深入浅出Node.js中的node_modules
|
开发者 前端开发 开发框架
JSF与移动应用,开启全新交互体验!让你的Web应用轻松征服移动设备,让用户爱不释手!
【8月更文挑战第31天】在现代Web应用开发中,移动设备的普及使得构建移动友好的应用变得至关重要。尽管JSF(JavaServer Faces)主要用于Web应用开发,但结合Bootstrap等前端框架,也能实现优秀的移动交互体验。本文探讨如何在JSF应用中实现移动友好性,并通过示例代码展示具体实现方法。使用Bootstrap的响应式布局和组件可以确保JSF页面在移动设备上自适应,并提供友好的表单输入和提交体验。尽管JSF存在组件库较小和学习成本较高等局限性,但合理利用其特性仍能显著提升用户体验。通过不断学习和实践,开发者可以更好地掌握JSF应用的移动友好性,为Web应用开发贡献力量。
200 1