在npm install,angular4上出现茉莉花错误

我想在angular-4项目上运行npm install,它给了我错误,

我的package.json是:

"devDependencies": {
    "@angular/compiler-cli": "^4.4.6","@angular/language-service": "^4.4.6","@compodoc/compodoc": "^1.1.6","@types/jasmine": "^2.8.3",

"typescript": "~2.3.3" in dependencies.


ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,227): ':' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,47): ';' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,104): ']' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,112): ',' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,113): Property assignment expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,121): ')' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,147): '(' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,162): ']' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,163): ',164): Property assignment expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,165): Property assignment expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,179): ',183): ':' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,208): '{' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,217): ':' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,222): ',90): '(' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,228): Expression expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,230): ')' expected.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,68): 'ReadonlyArray' only refers to a type,but is being used as a value here.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,92): The right-hand side of an arithmetic operation must be of type 'any','number' or an enum type.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,94): Cannot find name 'methodName'.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,106): Cannot find name 'string'.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,124): 'ReadonlyArray' only refers to a type,149): The right-hand side of an arithmetic operation must be of type 'any',150): A computed property name must be of type 'string','number','symbol',or 'any'.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,151): Cannot find name 'P'.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,156): Cannot find name 'keyof'.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,162): Cannot find name 'T'.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,180): Cannot find name 'P'.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,217): Cannot find name 'T'.
ERROR in /home/infinity/CiscoGit/AS/AS-BAC-BPA/node_modules/@types/jasmine/index.d.ts (138,219): Cannot find name 'P'.
您在package.json中使用以下 semver作为@ types / jasmine包:
"@types/jasmine": "^2.8.3"

^意味着您的软件包安装程序将下载可用于所述软件包的最新次要版本,在本例中为2.8.11. (如果您访问https://www.npmjs.com/package/@types/jasmine,您会注意到他们在20小时前发布了最新版本2.8.11.)

有两种方法可以解决您的问题:1)确保您的Typescript版本与@ types / jasmine包兼容2)将您的版本锁定到特定版本(2.8.8相当稳定).希望这可以帮助!

相关文章

AngularJS 是一个JavaScript 框架。它可通过 注:建议把脚本放在 元素的底部。这会提高网页加载速度,因...
angluarjs中页面初始化的时候会出现语法{{}}在页面中问题,也即是页面闪烁问题。出现这个的原因是:由于...
AngularJS 通过被称为指令的新属性来扩展 HTML。AngularJS 指令AngularJS 指令是扩展的 HTML 属性,带有...
AngularJS 使用表达式把数据绑定到 HTML。AngularJS 表达式AngularJS 表达式写在双大括号内:{{ expres...
ng-repeat 指令可以完美的显示表格。在表格中显示数据 {{ x.Name }} {{ x.Country }} 使用 CSS 样式为了...
$http是 AngularJS 中的一个核心服务,用于读取远程服务器的数据。读取 JSON 文件下是存储在web服务器上...