mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	Check if node v0.1.x or v0.2.x before npm installs
This commit is contained in:
		
							
								
								
									
										8
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -115,7 +115,13 @@ nvm() | |||||||
|         if ! which npm ; then |         if ! which npm ; then | ||||||
|           echo "Installing npm..." |           echo "Installing npm..." | ||||||
|           # TODO: if node version 0.2.x add npm_install=0.2.19 before sh |           # TODO: if node version 0.2.x add npm_install=0.2.19 before sh | ||||||
|           curl http://npmjs.org/install.sh | clean=yes sh |           if [[ "`expr match $VERSION '\(^v0\.1\.\)'`" != '' ]]; then | ||||||
|  |             echo "npm requires node v0.2.x or higher" | ||||||
|  |           elif [[ "`expr match $VERSION '\(^v0\.2\.\)'`" != '' ]]; then | ||||||
|  |             curl http://npmjs.org/install.sh | clean=yes npm_install=0.2.19 sh | ||||||
|  |           else | ||||||
|  |             curl http://npmjs.org/install.sh | clean=yes sh | ||||||
|  |           fi | ||||||
|         fi |         fi | ||||||
|       else |       else | ||||||
|         echo "nvm: install $VERSION failed!" |         echo "nvm: install $VERSION failed!" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user