" nvm ls"没有显示任何已安装的NodeJ

时间:2016-05-19 01:24:11

标签: nvm

我使用nvm使用Ansible安装两个版本的NodeJ。

1)安装NVM: - 名称:安装nvm   sudo_user:go   shell:>       curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash的

  • name:更改nvm安装目录的权限 sudo_user:go 命令:bash -c' chmod -R 777~ / .nvm'

2)安装NodeJS 5.5.0和0.12.7 - name:安装节点v5.5.0   sudo_user:go   命令:bash -c'。 〜/ .nvm / nvm.sh; nvm install v5.5.0 / 0.12.7'   环境:     http_proxy:http://17.99.193.229:3128     https_proxy:http://17.99.193.229:3128

3)我没有收到任何错误。 4)当我键入" node -v"时,我得到了v5.5.0。 5)当我使用" nvm ls"使用" go"作为用户,我得到了: mkdir:无法创建目录`〜':权限被拒绝 节点 - >稳定( - > N / A)(默认) iojs - > N / A(默认)

正如您所看到的,我使用sudo_user进行所有安装,但我没有看到我安装的节点。

1 个答案:

答案 0 :(得分:0)

nvm维护者在这里 - 永远不要将 -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [self.webResponseData setLength:0]; } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { [self.webResponseData appendData:data]; } -(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { NSLog(@"%@" , error); NSLog(@"Some error in your Connection. Please try again."); } -(void)connectionDidFinishLoading:(NSURLConnection *)connection { NSLog(@"Received %lu Bytes", (unsigned long)[webResponseData length]); NSString *theXML = [[NSString alloc] initWithBytes: [webResponseData mutableBytes] length:[webResponseData length] encoding:NSUTF8StringEncoding]; NSLog(@"theXML%@",theXML); //now parsing the xml NSData *myData = [theXML dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; NSLog(@"myData%@",myData); NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:myData]; NSLog(@"xmlParser%@",xmlParser); //setting delegate of XML parser to self xmlParser.delegate = self; BOOL parsingResult; // Run the parser @try { parsingResult = [xmlParser parse]; NSLog(@"parsing result = %hhd",parsingResult); } @catch(NSException* exception) { UIAlertView* alert = [[UIAlertView alloc]initWithTitle:@"Server Error" message:[exception reason]delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alert show]; return; } } -(void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName: (NSString *)qName attributes:(NSDictionary *)attributeDict { currentElement = elementName; NSLog(@"currentElement%@",currentElement); } - (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { data = [string dataUsingEncoding:NSUTF8StringEncoding]; NSLog(@"string data come after parsing = %@",string); arrjson = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; if ([currentElement isEqualToString:@"GetElucHeaderDetailsResult"]) { currentElement=string } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { NSLog(@"Parsing Done"); } [{"GeoLevelCode":"AJ","GeoLevel":"S","ButterFlyType":"1","YearMonth":"0217","FinYear":"2017","Carrier":"KL","HeaderEluc":"NTR Further improvement of 11 Mln EUR, evenly split € UK and IE Sales Cost under control and in line ","DetailEluc":"NTR Further improvement of 11 Mln EUR, split between UK and IE for UK coming from Jan actuals vs PFC, IE shows improvement in rest of the year Access in general is ok and base load being established up, continued access remains key, yield slightly better than anticipated; Net Sales cost Relative small increase in Net Sales Cost, with increase in NTR keeping NSCR at same level as pfc; Net Station Cost very slight increase in Net Cost per Seat due to lowered seatsmovement with higher lounge costs (mix and usage), and slight increase in various Other Costs; FTE Slight decrease in KL Sales due to delayed recruitment of sales staff in UK, year effect 02 fte ","Details2Eluc":" vs BGT: Increase of NTR by 115 Mln Euro (bud rox), while Net Sales Cost decrease slightly FTE change from AF to KL due to vacancies being filled in on KLcontract Station Cost impacted by less seats with more movements and handling price increase at LHR Cost target settings from budget released, costs levels are cleaned for this effect","AddedOn":"3/1/20179:52:50PM","AddedBy":"KLM71111@caas","LastUpdatedOn":"","LastUpdatedBy":""}] 一起使用。 nvm是每用户;每个用户帐户都需要自己独立安装nvm和$ NVM_DIR。