运行离子服务面临错误后:找不到“节点”的类型定义文件。我已经重新安装了ionic,cordova和node.js,但仍然遇到此错误
C:\Users\ali\Documents\TransporterApp>ionic serve
[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to
cancel
[21:24:00] watch started ...
[21:24:00] build dev started ...
[21:24:00] clean started ...
[21:24:00] clean finished in 3 ms
[21:24:00] copy started ...
[21:24:00] transpile started ...
[21:24:07] typescript: ...ts/TransporterApp/node_modules/@angular/tsc-wrapped/src/vinyl_file.d.ts, line: 1
Cannot find type definition file for 'node'.
L1:导出接口VinylFile扩展对象{
L2:路径:字符串;
[21:24:07] typescript: ...ts/TransporterApp/node_modules/@angular/tsc-wrapped/src/vinyl_file.d.ts, line: 11
Cannot find name 'Buffer'.
[21:24:07] typescript: ...D2D-Transporter/node_modules/@ionic/app-scripts/dist/util/clean-css-factory.d.ts, line: 2
Namespace ''*'' has no exported member 'Options'.
L1:从“ clean-css”导入*作为cleanCss;
L2:导出声明函数getCleanCssInstance(选项:cleanCss.Options):cleanCss;
L3:导出接口CleanCssConfig {
[21:24:07] typescript: ...D2D-Transporter/node_modules/@ionic/app-scripts/dist/util/clean-css-factory.d.ts, line: 2
Cannot find name 'cleanCss'.
L1:从“ clean-css”导入*作为cleanCss;
L2:导出声明函数getCleanCssInstance(选项:cleanCss.Options):cleanCss;
L3:导出接口CleanCssConfig {
[21:24:07] typescript: ...D2D-Transporter/node_modules/@ionic/app-scripts/dist/util/clean-css-factory.d.ts, line: 6
Namespace ''*'' has no exported member 'Options'.
L5:destFileName:字符串;
L6:选项?:cleanCss.Options;
[21:24:07] typescript: ...2D-Transporter/node_modules/@ionic/app-scripts/dist/util/virtual-file-utils.d.ts, line: 1
Cannot find type definition file for 'node'.
L1: import { Stats } from 'fs';
L2: export declare class VirtualStats implements Stats {
[21:24:07] typescript: ...2D-Transporter/node_modules/@ionic/app-scripts/dist/util/virtual-file-utils.d.ts, line: 3
Cannot find name 'Stats'.
L2: export declare class VirtualStats implements Stats {
L3: protected _path: string;
L4: protected _ctime: Date;
[21:24:07] dev server running: http://localhost:8100/
[INFO] Development server running
Local: http://localhost:8100
[21:24:07] copy finished in 6.75 s
[21:24:07] watch ready in 6.97 s
System info are:
cli packages:
@ionic/cli-plugin-ionic-angular : 1.4.0 (C:\Users\ali\Documents\TransporterApp\node_modules\@ionic\cli-plugin-ionic-angular)
@ionic/cli-utils : 1.6.0 (C:\Users\ali\Documents\TransporterApp\node_modules\ionic\node_modules\@ionic\cli-utils)
ionic (Ionic CLI) : 3.6.0 (C:\Users\ali\Documents\TransporterApp\node_modules\ionic)
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 1.3.7
@ionic/cli-plugin-cordova : 1.4.1
Cordova Platforms : none
Ionic Framework : ionic-angular 3.2.1
System:
Android SDK Tools : 25.2.5
Node : v6.11.1
OS : Windows 7
npm : 3.10.10
最佳答案
我之前遇到过这个问题:
npm install @ types / node --save-dev
为我工作。
关于node.js - 运行 ionic 服务面临错误后:找不到“Node ”的类型定义文件,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/45402483/