mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-11-04 06:57:12 +00:00 
			
		
		
		
	Suppress error message when node is not in path
When nvm.sh is sourced in bashrc or zshrc, and if node is not found in the path, an error message is shown since which node fails. The patch suppresses this error message.
This commit is contained in:
		
							parent
							
								
									68574cc7e8
								
							
						
					
					
						commit
						f10504b11c
					
				
							
								
								
									
										2
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								nvm.sh
									
									
									
									
									
								
							@ -161,7 +161,7 @@ nvm_binary_available() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
nvm_ls_current() {
 | 
					nvm_ls_current() {
 | 
				
			||||||
  local NODE_PATH
 | 
					  local NODE_PATH
 | 
				
			||||||
  NODE_PATH="$(which node)"
 | 
					  NODE_PATH="$(which node 2>/dev/null)"
 | 
				
			||||||
  if [ $? -ne 0 ]; then
 | 
					  if [ $? -ne 0 ]; then
 | 
				
			||||||
    echo 'none'
 | 
					    echo 'none'
 | 
				
			||||||
  elif nvm_tree_contains_path "$NVM_DIR" "$NODE_PATH"; then
 | 
					  elif nvm_tree_contains_path "$NVM_DIR" "$NODE_PATH"; then
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user