首页 文章

错误的ERR! notarget找不到与[email protected]~2.9.0匹配的版本

提问于
浏览 1643 次
0

我创建了一个新的角度应用程序但在进行npm安装时,我收到以下错误 . 有人遇到过这种问题吗?

Here is my Package.json content: {"name":"my-exp","version":"0.0.0","license":"MIT","scripts":{"ng":"ng","start":"ng serve","build":"ng build","test":"ng test","lint":"ng lint","e2e":"ng e2e"},"private":真,"dependencies":{"@angular/animations" :"^5.1.2","@angular/cdk":"^5.0.4","@angular/common":"^5.0.0","@angular/compiler":"^5.0.0","@angular/core":"^5.0.0","@angular/forms":"^5.0.0","@angular/http":"^5.0.0","@angular/material":"^5.0.4","@angular/platform-browser":"^5.0.0","@angular/platform-browser-dynamic":"^5.0.0","@angular/router":"^5.0.0","core-js":"^2.4.1","hammerjs":"^2.0.8" ,"rxjs":"^5.4.1","zone.js":"^0.8.14"},"devDependencies":{"@angular/cli":"^1.6.4","@angular/compiler-cli":"^5.0.0","@angular/language-service":"^5.0.0","@types/jasmine":"^2.6.3","@types/jasminewd2":"~2.0.2","@types/node":"~8.0.47","codelyzer":"~4.0.0","jasmine-core":"~2.8.0","jasmine-spec-reporter":"~4.2.1","karma" :"~1.7.0",_ "karma-chrome-launcher":"~2.2.0","karma-cli":"~1.0.1","karma-coverage-istanbul-reporter":"^1.2.1","karma-jasmine":"~1.1.0","karma-jasmine-html-reporter":"^0.2.2","protractor":"~5.2.0","ts-node":"~3.3.0","tslint":"~5.8.0","typescript":"~2.6.1"}}

THis is the error

错误的ERR!代码ETARGET

错误的ERR! notarget找不到与[email protected]~2.9.0匹配的版本

错误的ERR! notarget在大多数情况下,您或您的某个依赖项正在请求

错误的ERR!找不到不存在的包版本 .

错误的ERR! notarget npm ERR! notarget它被指定为'jasmine'的依赖

错误的ERR!没有目标

错误的ERR!可以在以下位置找到此运行的完整日志:

1 回答

  • 0

    jasmine-core是一个peerDependency,它不会从病房的npm 3自动安装 . 您需要手动安装它 .

    • 本地安装:npm install jasmine-core --save-dev

    • 检查以确保安装的版本与package.json中的版本相同 . 如有必要,更新package.json中的那个 .

    • 执行npm安装 .

    或者,如果您在项目中没有使用karma-jasmine,只需从package.json中的devDependencies中删除jasmine-core并执行npm install . 构建应该成功,并发出警告,如下所示:

    npm WARN [email protected]需要jasmine-core @ *的同行,但没有安装 . 您必须自己安装对等依赖项 .

相关问题