2017-02-24 73 views
0

我想升级我的角度2.0.0应用2.4.8我用下面的链接引导https://www.npmjs.com/package/npm-check-updates。但我得到一些错误。升级的角度2.0.0到2.4.x

老依赖

dependencies": { 
"@angular/common": "2.0.0", 
"@angular/compiler": "2.0.0", 
"@angular/core": "2.0.0", 
"@angular/forms": "2.0.0", 
"@angular/http": "2.0.0", 
"@angular/platform-browser": "2.0.0", 
"@angular/platform-browser-dynamic": "2.0.0", 
"@angular/platform-server": "2.0.0", 
"@angular/router": "3.0.0", 
"@types/node": "^6.0.38", 
"angular2-platform-node": "~2.0.10", 
"angular2-universal": "~2.0.10", 
"angular2-universal-polyfills": "~2.0.10", 
"aspnet-prerendering": "^1.0.6", 
"aspnet-webpack": "^1.0.11", 
"bootstrap": "^3.3.7", 
"css": "^2.2.1", 
"css-loader": "^0.25.0", 
"es6-shim": "^0.35.1", 
"expose-loader": "^0.7.1", 
"extract-text-webpack-plugin": "^1.0.1", 
"file-loader": "^0.9.0", 
"isomorphic-fetch": "^2.2.1", 
"jquery": "^2.2.1", 
"preboot": "^4.5.2", 
"raw-loader": "^0.5.1", 
"rxjs": "5.0.0-beta.12", 
"style-loader": "^0.13.0", 
"to-string-loader": "^1.1.5", 
"ts-loader": "^0.8.2", 
"typescript": "^2.0.0", 
"url-loader": "^0.5.7", 
"webpack": "^1.12.14", 
"webpack-externals-plugin": "^1.0.0", 
"webpack-hot-middleware": "^2.10.0", 
"webpack-merge": "^0.14.1", 
"zone.js": "^0.6.21" 
} 

新的依赖

"dependencies": { 
"@angular/common": "2.4.8", 
"@angular/compiler": "2.4.8", 
"@angular/core": "2.4.8", 
"@angular/forms": "2.4.8", 
"@angular/http": "2.4.8", 
"@angular/platform-browser": "2.4.8", 
"@angular/platform-browser-dynamic": "2.4.8", 
"@angular/platform-server": "2.4.8", 
"@angular/router": "3.4.8", 
"@types/node": "^7.0.5", 
"angular2-platform-node": "~2.1.0-rc.1", 
"angular2-universal": "~2.1.0-rc.1", 
"angular2-universal-polyfills": "~2.1.0-rc.1", 
"aspnet-prerendering": "^2.0.3", 
"aspnet-webpack": "^1.0.11", 
"bootstrap": "^3.3.7", 
"css": "^2.2.1", 
"css-loader": "^0.26.1", 
"es6-shim": "^0.35.1", 
"expose-loader": "^0.7.1", 
"extract-text-webpack-plugin": "^1.0.1", 
"file-loader": "^0.10.0", 
"isomorphic-fetch": "^2.2.1", 
"jquery": "^3.1.1", 
"preboot": "^4.5.2", 
"raw-loader": "^0.5.1", 
"rxjs": "5.2.0", 
"style-loader": "^0.13.0", 
"to-string-loader": "^1.1.5", 
"ts-loader": "^2.0.1", 
"typescript": "^2.0.0", 
"url-loader": "^0.5.7", 
"webpack": "^2.2.1", 
"webpack-externals-plugin": "^1.0.0", 
"webpack-hot-middleware": "^2.10.0", 
"webpack-merge": "^3.0.0", 
"zone.js": "^0.7.7" 
} 

app.module.ts

import { NgModule } from '@angular/core'; 
import { RouterModule } from '@angular/router'; 
import { UniversalModule } from 'angular2-universal'; 
import { AppComponent } from './components/app/app.component' 
import { NavMenuComponent } from './components/navmenu/navmenu.component'; 
import { HomeComponent } from './components/home/home.component'; 
import { FetchDataComponent } from './components/fetchdata/fetchdata.component'; 
import { CounterComponent } from './components/counter/counter.component'; 

@NgModule({ 
    bootstrap: [ AppComponent ], 
    declarations: [ 
     AppComponent, 
     NavMenuComponent, 
     CounterComponent, 
     FetchDataComponent, 
     HomeComponent 
    ], 
    imports: [ 
     UniversalModule, // Must be first import. This automatically imports BrowserModule, HttpModule, and JsonpModule too. 
     RouterModule.forRoot([ 
      { path: '', redirectTo: 'home', pathMatch: 'full' }, 
      { path: 'home', component: HomeComponent }, 
      { path: 'counter', component: CounterComponent }, 
      { path: 'fetch-data', component: FetchDataComponent }, 
      { path: '**', redirectTo: 'home' } 
     ]) 
    ] 
}) 
export class AppModule { 
} 

错误日志

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules\chokidar\node_modules\fsevents): 
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) 
npm WARN [email protected] requires a peer of [email protected]^1.9.11 but none was installed. 
npm WARN [email protected] requires a peer of [email protected]~0.6.21 but none was installed. 
npm WARN [email protected] requires a peer of [email protected]~5.0.0-beta.12 but none was installed. 
npm WARN [email protected] requires a peer of [email protected]~0.6.21 but none was installed. 
npm WARN [email protected] No repository field. 
npm WARN [email protected] No license field. 
npm ERR! Windows_NT 10.0.14393 
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\ivisual\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" 
npm ERR! node v6.9.4 
npm ERR! npm v4.1.1 
npm ERR! path C:\Users\ivisual\Documents\Visual Studio 2015\Projects\ng20\ng20\node_modules\.staging\lodash-f67ffa4b\fp\bindAll.js 
npm ERR! code ENOENT 
npm ERR! errno -4058 
npm ERR! syscall lstat 

npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\ivisual\Documents\Visual Studio 2015\Projects\ng20\ng20\node_modules\.staging\lodash-f67ffa4b\fp\bindAll.js' 
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\ivisual\Documents\Visual Studio 2015\Projects\ng20\ng20\node_modules\.staging\lodash-f67ffa4b\fp\bindAll.js' 
npm ERR! enoent This is most likely not a problem with npm itself 
npm ERR! enoent and is related to npm not being able to find a file. 
npm ERR! enoent 

npm ERR! Please include the following file with any support request: 
npm ERR!  C:\Users\ivisual\Documents\Visual Studio 2015\Projects\ng20\ng20\npm-debug.log 
+0

没有尝试缓存清理? –

+0

@suraj我清理了node_modules文件夹,如果你的意思是 – mohsen

+0

它的依赖不匹配。你的'extract-text-webpack-plugin'需要一个较低版本的'webpack','angular-universal'也需要较低版本的'rxjs'。检查它是否适用于较低版本 –

回答

2

我改变了我的package.json如下,它的工作。

"dependencies": { 
    "@angular/common": "^2.4.5", 
    "@angular/compiler": "^2.4.5", 
    "@angular/core": "^2.4.5", 
    "@angular/forms": "^2.4.5", 
    "@angular/http": "^2.4.5", 
    "@angular/platform-browser": "^2.4.5", 
    "@angular/platform-browser-dynamic": "^2.4.5", 
    "@angular/platform-server": "^2.4.5", 
    "@angular/router": "^3.4.5", 
    "@types/node": "^6.0.42", 
    "angular2-platform-node": "~2.0.11", 
    "angular2-template-loader": "^0.6.2", 
    "angular2-universal": "^2.1.0-rc.1", 
    "angular2-universal-patch": "^0.2.1", 
    "angular2-universal-polyfills": "^2.1.0-rc.1", 
    "aspnet-prerendering": "^2.0.0", 
    "aspnet-webpack": "^1.0.17", 
    "awesome-typescript-loader": "^3.0.0", 
    "bootstrap": "^3.3.7", 
    "css": "^2.2.1", 
    "css-loader": "^0.25.0", 
    "es6-shim": "^0.35.1", 
    "event-source-polyfill": "^0.0.7", 
    "expose-loader": "^0.7.1", 
    "extract-text-webpack-plugin": "^2.0.0-rc", 
    "file-loader": "^0.9.0", 
    "html-loader": "^0.4.4", 
    "isomorphic-fetch": "^2.2.1", 
    "jquery": "^2.2.1", 
    "json-loader": "^0.5.4", 
    "preboot": "^4.5.2", 
    "raw-loader": "^0.5.1", 
    "rxjs": "^5.0.1", 
    "style-loader": "^0.13.1", 
    "to-string-loader": "^1.1.5", 
    "typescript": "^2.2.1", 

    "url-loader": "^0.5.7", 
    "webpack": "^2.2.0", 

    "webpack-hot-middleware": "^2.12.2", 
    "webpack-merge": "^0.14.1", 
    "zone.js": "^0.7.6" 
    } 
+0

我一直在跟踪这些f *依赖关系2个小时。你救了我的一天,谢谢! – Perrier