Blog Content

    티스토리 뷰

    [Angular] angular-cli 업데이트 하는 방법

    Updating Angular CLI (@angular/cli 버전 - 상위버전)

    If you're using Angular CLI 1.0.0-beta.28 or less, you need to uninstall angular-cli package. It should be done due to changing of package's name and scope from angular-cli to @angular/cli:

    npm uninstall -g angular-cli
    npm uninstall --save-dev angular-cli

    To update Angular CLI to a new version, you must update both the global package and your project's local package.

    Global package:

    npm uninstall -g @angular/cli
    npm cache clean
    npm install -g @angular/cli@latest

    Local project package:

    rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell
    npm install --save-dev @angular/cli@latest
    npm install


    Updating angular-cli (angular-cli 버전- 하위버전)

    To update angular-cli to a new version, you must update both the global package and your project's local package.

    Global package:

    npm uninstall -g angular-cli
    npm cache clean
    npm install -g angular-cli@latest
    

    Local project package:

    rm -rf node_modules dist tmp # On Windows use rmdir /s /q node_modules dist tmp
    npm install --save-dev angular-cli@latest
    npm install
    ng init
    

    Running ng init will check for changes in all the auto-generated files created by ng new and allow you to update yours. You are offered four choices for each changed file: y (overwrite), n (don't overwrite), d (show diff between your file and the updated file) and h (help).

    Carefully read the diffs for each code file, and either accept the changes or incorporate them manually after ng init finishes.

    Comments