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.

 


相关文章
|
7月前
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
webpack 使用打包报错 ERROR in node_modules\@types\node\ts4.8\assert.d.ts
511 0
|
4月前
|
开发者 Java 存储
JSF 与 CDI 携手共进,紧跟技术热点,激发开发者情感共鸣,开启高效开发新征程
【8月更文挑战第31天】JavaServer Faces (JSF) 与 Contexts and Dependency Injection (CDI) 在 Java EE 领域中紧密协作,助力开发者高效构建现代 Web 应用。JSF 凭借其丰富的组件库和页面导航功能受到青睐,而 CDI 则优雅地管理对象生命周期并实现依赖注入。两者结合,不仅简化了复杂企业应用的开发,还实现了松耦合架构,增强了代码的灵活性、可维护性和可扩展性。通过示例展示了如何利用 CDI 将业务服务对象注入 JSF Managed Bean,以及如何在不同页面间共享数据,突显了这一组合的强大功能。
43 0
|
4月前
|
存储 JavaScript 数据库
如何使用 Socket.IO、Angular 和 Node.js 创建实时应用程序
如何使用 Socket.IO、Angular 和 Node.js 创建实时应用程序
32 0
|
4月前
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.
74 0
|
7月前
|
存储 缓存 资源调度
深入浅出Node.js中的node_modules(二)
深入浅出Node.js中的node_modules
|
5月前
|
开发工具 git
vscode设置 git提交代码忽略node_modules,dist,vscode如何设置不提交node_modules,dist
vscode设置 git提交代码忽略node_modules,dist,vscode如何设置不提交node_modules,dist
581 0
|
7月前
LabVIEW使用VI服务器的调用节点将数据传递到另一个VI 使用调用节点(Invoke Node)与通过引用调用节点(Call by Reference)调用VI时有什么差别?
LabVIEW使用VI服务器的调用节点将数据传递到另一个VI 使用调用节点(Invoke Node)与通过引用调用节点(Call by Reference)调用VI时有什么差别?
181 0
|
7月前
|
存储 资源调度 JavaScript
深入浅出Node.js中的node_modules(三)
深入浅出Node.js中的node_modules
|
7月前
|
资源调度 JavaScript API
深入浅出Node.js中的node_modules(一)
深入浅出Node.js中的node_modules
|
4月前
|
API 开发者 UED
PrimeFaces:JSF的魔法衣橱,解锁UI设计的无限可能!
【8月更文挑战第31天】本文介绍如何结合 JSF(JavaServer Faces)和 PrimeFaces 构建美观且功能强大的现代用户界面。PrimeFaces 提供丰富的 UI 组件库,包括按钮、输入框、数据网格等,支持现代 Web 标准,简化界面开发。文章通过具体示例展示如何使用 `&lt;p:inputText&gt;` 和 `&lt;p:calendar&gt;` 等组件创建用户表单,并用 `&lt;p:dataTable&gt;` 展示数据集合,提升 JSF 应用的易用性和开发效率。
71 0

热门文章

最新文章