小阿阳啊 2022-01-18 15:03 采纳率: 100%
浏览 1485
已结题

node项目运行报错,如何解决?

node项目运行时报错,报错信息如下:

Debugger attached.

> orderreconciliation@0.0.0 start
> ng serve

Debugger attached.
(node:19444) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
  0% compilingDebugger attached.
 11% building modules 9/12 modules 3 active ...5.0.9\laydate\theme\default\laydate.cssBrowserslist: caniuse-lite is outdated. Please run next command `npm update`
                                                                                          
Date: 2022-01-18T06:55:30.534Z
Hash: f198538fb4fe3bf85c33    
Time: 13550ms
chunk {main} main.js, main.js.map (main) 1.94 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 93.3 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 26.4 kB  [rendered]
chunk {styles} styles.js, styles.js.map (styles) 41.5 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 327 kB [initial] [rendered]

ERROR in node_modules/@ngx-translate/core/lib/translate.directive.d.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.directive.d.ts(15,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(49,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(63,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(67,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(68,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(72,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(73,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(77,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(78,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(82,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@ngx-translate/core/lib/translate.service.d.ts(83,9): error TS1086: An accessor cannot be declared in an ambient context.

下面这部分是我的package.json

{
  "name": "orderreconciliation",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~7.1.0",
    "@angular/common": "~7.1.0",
    "@angular/compiler": "~7.1.0",
    "@angular/core": "~7.1.0",
    "@angular/forms": "~7.1.0",
    "@angular/platform-browser": "~7.1.0",
    "@angular/platform-browser-dynamic": "~7.1.0",
    "@angular/router": "~7.1.0",
    "@ngx-translate/core": "^13.0.0",
    "@ngx-translate/http-loader": "^6.0.0",
    "@types/jquery": "^3.5.1",
    "core-js": "^2.5.4",
    "ngx-loading": "^8.0.0",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.11.0",
    "@angular/cli": "~7.1.4",
    "@angular/compiler-cli": "~7.1.0",
    "@angular/language-service": "~7.1.0",
    "@types/node": "~8.9.4",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~3.1.6"
  }
}

求解答,谢谢!

  • 写回答

1条回答 默认 最新

  • 一只成序源 2022-01-18 15:12
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 系统已结题 2月16日
  • 已采纳回答 2月8日
  • 创建了问题 1月18日

悬赏问题

  • ¥20 Windows 驱动开发版本疑问相关
  • ¥15 MAC 未能打开磁盘映像
  • ¥15 fastcap使用,二维导体输入问题
  • ¥15 hosts修改后不能访问
  • ¥15 关于化学反应速率C++编译问题/FLUENT
  • ¥20 Yolov5训练报错
  • ¥15 Unity发布gzip压缩的webgl之后让浏览器可以正常显示画面
  • ¥15 ASP.net Gridview插件数据更新失败问题
  • ¥15 有没有人知道这种提示怎么关?现在不做ts项目了不知道咋关了,求解,现在我以前的js项目都是这种提示了
  • ¥15 为什么mysql做了碎片化处理data_free还是很高