微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在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相当稳定).希望这可以帮助!

原文地址:https://www.jb51.cc/angularjs/142489.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐