簡體   English   中英

Angular 4:先前正在運行的github項目的本地版本出錯

[英]Angular 4: Error on local build of github project that was previously working

所以我在github上有一個項目,我試圖升級到Angular 5.。起初似乎起作用,但是后來我發現了怪異的bug,只想繼續使用上一次提交中的工作。 Angular 4 ..但是當我嘗試構建項目時,我不斷收到此錯誤:

ERROR in /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (232,41): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (233,41): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1252,41): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1253,41): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1972,55): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1976,54): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1986,55): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1991,57): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (2005,48): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (2088,22): ',' expected.)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (232,94): Generic type 'IDirectiveFactory<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (233,96): Generic type 'IDirectiveFactory<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1252,94): Generic type 'IDirectiveFactory<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1253,96): Generic type 'IDirectiveFactory<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1973,27): Generic type 'IDirective<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1973,48): Generic type 'IDirectiveLinkFn<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1987,15): Generic type 'IDirectiveLinkFn<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (1988,16): Generic type 'IDirectiveLinkFn<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (2002,19): Generic type 'IDirectiveLinkFn<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (2002,46): Generic type 'IDirectivePrePost<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (2006,19): Generic type 'IDirectiveCompileFn<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (2015,16): Generic type 'IDirectiveLinkFn<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (2015,43): Generic type 'IDirectivePrePost<TScope, IScope>' requires 2 type argument(s).)
    /Users/lsorensen/code/OneUnionV1/node_modules/@types/angular/index.d.ts (2088,24): Type parameter name cannot be 'any')
npm ERR! code ELIFECYCLE

的package.json

{
  "name": "TheOneUnion",
  "version": "1.0.0",
  "main": "index.js",
  "repository": {},
  "scripts": {
    "start": "npm run build && npm run server",
    "build": "webpack --progress --color",
    "build:aot": "webpack --env.aot --env.client & webpack --env.aot --env.server",
    "build:prod": "webpack --env.aot --env.client -p & webpack --env.aot --env.server",
    "prebuild": "npm run clean",
    "prebuild:aot": "npm run clean",
    "prebuild:prod": "npm run clean",
    "clean": "rimraf dist",
    "server": "nodemon dist/server.js",
    "watch": "webpack --watch",
    "watch:dev": "npm run server & npm run watch",
    "debug:server": "node-nightly --inspect --debug-brk dist/server.js & webpack --watch"
  },
  "engines": {
    "node": ">=6.0.0"
  },
  "license": "MIT",
  "dependencies": {
    "@agm/core": "1.0.0-beta.0",
    "@angular/animations": "4.4.3",
    "@angular/cdk": "2.0.0-beta.11",
    "@angular/common": "4.4.3",
    "@angular/core": "4.4.3",
    "@angular/forms": "4.4.3",
    "@angular/http": "4.4.3",
    "@angular/material": "2.0.0-beta.11",
    "@angular/platform-browser": "4.4.3",
    "@angular/platform-browser-dynamic": "4.4.3",
    "@angular/platform-server": "4.4.3",
    "@angular/router": "4.4.3",
    "@nguniversal/express-engine": "1.0.0-beta.2",
    "@types/mongodb": "2.2.0",
    "angular2-jwt": "0.2.0",
    "autoprefixer": "6.7.6",
    "aws-sdk": "2.23.0",
    "base64url": "2.0.0",
    "bcrypt-nodejs": "0.0.3",
    "bluebird": "3.5.0",
    "body-parser": "1.17.1",
    "bootstrap-sass": "3.3.7",
    "compression": "1.6.2",
    "crypto": "0.0.3",
    "css-loader": "0.25.0",
    "css-to-string-loader": "0.1.2",
    "debug": "2.6.8",
    "elasticsearch": "12.1.3",
    "evaporate": "2.0.9",
    "express": "4.15.2",
    "extract-text-webpack-plugin": "2.1.0",
    "global": "4.3.2",
    "gm": "1.23.0",
    "hammerjs": "2.0.8",
    "html-metadata": "^1.6.3",
    "imports-loader": "0.7.1",
    "js.clone": "0.0.3",
    "jsonwebtoken": "7.3.0",
    "lodash": "4.17.4",
    "log4js": "1.1.1",
    "methods": "1.1.2",
    "minilog": "3.1.0",
    "moment": "2.18.1",
    "mongoose": "4.11.4",
    "morgan": "1.8.1",
    "ng2-facebook-sdk": "2.3.1",
    "node-ffprobe": "1.2.2",
    "node-sass": "4.5.0",
    "nodemailer": "4.1.0",
    "normalize.css": "7.0.0",
    "postcss-loader": "1.3.3",
    "preboot": "4.5.2",
    "request": "2.80.0",
    "rxjs": "5.3.0",
    "sass-loader": "6.0.2",
    "webfontloader": "1.6.27",
    "xhr2": "0.1.4",
    "zone.js": "0.8.8"
  },
  "devDependencies": {
    "@angular/compiler": "4.4.3",
    "@angular/compiler-cli": "4.4.3",
    "@angular/core": "4.4.3",
    "@ngtools/webpack": "1.2.14",
    "@types/angular-material": "1.1.54",
    "@types/aws-sdk": "0.0.42",
    "@types/base64url": "2.0.3",
    "@types/bluebird": "3.5.3",
    "@types/body-parser": "0.0.34",
    "@types/compression": "0.0.33",
    "@types/cookie-parser": "1.3.30",
    "@types/elasticsearch": "5.0.12",
    "@types/evaporate": "0.0.18",
    "@types/express": "4.0.35",
    "@types/express-serve-static-core": "4.0.40",
    "@types/gm": "1.17.29",
    "@types/googlemaps": "^3.29.1",
    "@types/hammerjs": "2.0.34",
    "@types/jasmine": "2.5.43",
    "@types/jasminewd2": "2.0.1",
    "@types/jsonwebtoken": "7.2.0",
    "@types/lodash": "4.14.54",
    "@types/mime": "0.0.29",
    "@types/mongoose": "4.7.19",
    "@types/morgan": "1.7.32",
    "@types/node": "7.0.8",
    "@types/nodemailer": "1.3.32",
    "@types/request": "0.0.41",
    "@types/serve-static": "1.7.31",
    "@types/webfontloader": "1.6.28",
    "html-webpack-plugin": "2.28.0",
    "node-loader": "0.6.0",
    "nodemon": "1.11.0",
    "raw-loader": "0.5.1",
    "rimraf": "2.6.1",
    "script-ext-html-webpack-plugin": "1.7.1",
    "typescript": "2.5.3",
    "webpack": "3.5.5",
    "webpack-merge": "4.1.0",
    "webpack-node-externals": "1.6.0"
  }
}

其他從事該項目的開發人員已經確認,他們可以在同一分支上運行構建,我很好。所以這一定是本地問題。我已經嘗試了所有方法。 刪除並重新克隆。 清理緩存..刪除並重新安裝節點和所有全局軟件包,甚至重新安裝macOS ...,仍然是相同的錯誤。 如果有人對我可以嘗試的事情有一點想法,我將非常感激。

使用TypeScript 2.4.2和RxJS 5.4.2

我遇到過同樣的問題。 以下對我有用:我已經從項目文件夾中全局卸載了打字稿(sudo npm uninstall -g打字稿)。 然后使用--save-dev在項目文件夾中安裝打字稿(sudo npm install --save-dev typescript @'> = 2.1.0 <2.4.0')。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM