angular2-jwt.d.ts给出“找不到模块’@ angular / http”错误

前端之家收集整理的这篇文章主要介绍了angular2-jwt.d.ts给出“找不到模块’@ angular / http”错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在研究angular2“2.0.0-beta.17”.

我的package.json如下

"dependencies": {
        "angular2": "2.0.0-beta.17","es6-shim": "^0.35.0","reflect-Metadata": "0.1.2","rxjs": "5.0.0-beta.6","zone.js": "0.6.12","angular2-jwt":"0.1.15","es6-promise": "^3.2.1","jwt-decode": "^2.0.1"    
      },"devDependencies": {
        "angular-cli": "0.0.*","autoprefixer": "^6.3.2","copy-webpack-plugin": "^1.1.1","css-loader": "^0.23.0","extract-text-webpack-plugin": "^1.0.1","file-loader": "^0.8.4","html-loader": "^0.4.0","html-webpack-plugin": "^2.8.1","istanbul-instrumenter-loader": "^0.1.3","jasmine-core": "^2.3.4","jasmine-spec-reporter": "^2.4.0","json-loader": "^0.5.3","karma": "0.13.19","karma-chrome-launcher": "^0.2.1","karma-coverage": "^0.5.2","karma-jasmine": "^0.3.7","karma-phantomjs-launcher": "^1.0.0","karma-sourcemap-loader": "^0.3.7","karma-webpack": "1.7.0","node-sass": "^3.4.2","null-loader": "git+https://github.com/webpack/null-loader.git","phantomjs-prebuilt": "^2.1.4","postcss-loader": "^0.8.0","protractor": "^3.1.1","raw-loader": "0.5.1","rimraf": "^2.5.1","sass-loader": "^3.1.2","style-loader": "^0.13.0","ts-loader": "^0.8.1","tslint": "^3.4.0","tslint-loader": "^2.1.0","typedoc": "^0.3.12","typescript": "^1.8.0","typings": "^0.7.12","url-loader": "^0.5.6","webpack": "^1.12.13","webpack-dev-server": "^1.14.1","exports-loader": "^0.6.3","expose-loader": "^0.7.1","imports-loader": "^0.6.5","tsconfig-lint": "^0.7.0"
      }

但在构建我的项目后,我得到以下错误

ERROR in
C:\Users\akhilesh.kumar\Desktop\ang17\node_modules\angular2-jwt\angular2-jwt.d.ts
(1,61): error TS2307: Cannot find module ‘@angular/http’.

ERROR in ./~/angular2-jwt/angular2-jwt.js Module not found: Error:
Cannot resolve module ‘@angular/core’ in
C:\Users\akhilesh.kumar\Desktop\ang17\node_modules\angular2-jwt @
./~/angular2-jwt/angular2-jwt.js 11:13-37

ERROR in ./~/angular2-jwt/angular2-jwt.js Module not found: Error:
Cannot resolve module ‘@angular/http’ in
C:\Users\akhilesh.kumar\Desktop\ang17\node_modules\angular2-jwt @
./~/angular2-jwt/angular2-jwt.js 12:13-37

@ angular / http仅适用于Angular2的RC版本.在它之前是angular2 / http.

由于angular2-jwt库需要@ angular / http模块,因此您需要将应用程序升级到Angular2的RC版本.

为此,您可以更新package.json文件并执行命令:npm install:

"dependencies": {
   "@angular": "2.0.0-rc.1",(...)
}

猜你在找的Angularjs相关文章