mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 10:15:53 +08:00 
			
		
		
		
	[Fix] nvm install: Handle 'N/A' version instead of asking to install it
				
					
				
			Fixes #1304.
This commit is contained in:
		
				
					committed by
					
						 Jordan Harband
						Jordan Harband
					
				
			
			
				
	
			
			
			
						parent
						
							03608291a6
						
					
				
				
					commit
					8c03637023
				
			
							
								
								
									
										8
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -2626,10 +2626,14 @@ nvm() { | ||||
|         fi | ||||
|         return 8 | ||||
|       fi | ||||
|  | ||||
|       if [ "${VERSION}" = 'N/A' ]; then | ||||
|         nvm_err "N/A: version \"${PROVIDED_VERSION} -> ${VERSION}\" is not yet installed." | ||||
|         nvm_err "" | ||||
|         nvm_err "You need to run \"nvm install ${PROVIDED_VERSION}\" to install it before using it." | ||||
|         return 3 | ||||
|       # This nvm_ensure_version_installed call can be a performance bottleneck | ||||
|       # on shell startup. Perhaps we can optimize it away or make it faster. | ||||
|       if ! nvm_ensure_version_installed "${VERSION}"; then | ||||
|       elif ! nvm_ensure_version_installed "${VERSION}"; then | ||||
|         return $? | ||||
|       fi | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user