全球范围内将AngularCLI版本从1.0.0-beta.30回滚到1.0.0-beta.26?

时间:2017-02-10 02:24:21

标签: angular angular-cli

运行这些后:

npm uninstall -g angular-cli @angular/cli
npm cache clean
npm install -g angular-cli@1.0.0-beta.26

然后,我尝试了这个:

ng --version

这是我的结果:

angular-cli: 1.0.0-beta.26
node: 7.2.1
os: darwin x64
@angular/cli: 1.0.0-beta.30
@angular/common: 2.4.7
@angular/compiler: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.4.7
@angular/http: 2.4.7
@angular/material: 2.0.0-beta.1
@angular/platform-browser: 2.4.7
@angular/platform-browser-dynamic: 2.4.7
@angular/router: 3.4.7
@angular/compiler-cli: 2.4.7

正如你所看到的,@ angular / cli:1.0.0-beta.30仍然存在。我在MacOSX上运行它。

对此有任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:2)

npm uninstall angular-cli @angular/cli --save-dev
npm install angular-cli@1.0.0-beta.26 --save-dev

标记 -g 表示您已将其全局删除

Service will return the role id, each user is assigned a unique role id, first capture the role id and then do the data handling

      this.inviteService.getRoles().subscribe(data => {
        this.sessionService.set('roles',data);
        this.roles =this.sessionService.get<any>('roles');
        var rolesList: any=[];`enter code here`
        if(this.sessionService.getHigherRoleId() == 2)
//getHigherRoledId is returned from a service, which gives the roleId
        {
          this.roles.forEach(singleRole => {
            if (!((singleRole.id ==1)||(singleRole.id == 3))){
              rolesList.push(singleRole);

            }
          });

          this.roles=[];
         this.roles = rolesList;
        }

这将从本地安装中删除软件包并将更改保存到package.json