通过CLI创建Angular 2项目中的问题

时间:2018-06-19 17:17:38

标签: angular github angular-cli

在Visual Studio代码中运行npm install -g angular/cli命令时,我收到以下错误消息。

  

14错误执行时出错:14错误C:\ Program   Files \ Git \ cmd \ git.EXE ls-remote -h -t   ssh://git@github.com/angular/cli.git 14错误14错误主机密钥   验证失败。 14错误致命:无法从远程读取   资料库。 14错误14错误请确保您输入正确   访问权限14错误,并且存储库存在。 14错误14错误   退出,错误代码:128 15 verbose exit [1,true] ##

1 个答案:

答案 0 :(得分:0)

尝试以下操作:

if notFailedYet:
    tries = 0
    while miles <0 and tries <3:
        print('Error: enter a valid value')
        miles = float(input('Please enter how many miles you would like to convert.'))
        tries+=1
        if tries ==3 and miles <0:
            notFailedYet = False #Set this to false so that the other functions don't execute
            print('Error: valid value not entered.')
            return miles

    if tries <=2:
        km_miles = (miles *1.6)
        return print(miles, 'miles is equal to', format(km_miles ,',.2f'), 'kilometers.')

:)