mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	Fixes npm version check for node v0.2.0, v0.2.1 and v0.2.2
This commit is contained in:
		
							
								
								
									
										7
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -114,11 +114,14 @@ nvm() | |||||||
|         nvm use $VERSION |         nvm use $VERSION | ||||||
|         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 |  | ||||||
|           if [[ "`expr match $VERSION '\(^v0\.1\.\)'`" != '' ]]; then |           if [[ "`expr match $VERSION '\(^v0\.1\.\)'`" != '' ]]; then | ||||||
|             echo "npm requires node v0.2.x or higher" |             echo "npm requires node v0.2.3 or higher" | ||||||
|           elif [[ "`expr match $VERSION '\(^v0\.2\.\)'`" != '' ]]; then |           elif [[ "`expr match $VERSION '\(^v0\.2\.\)'`" != '' ]]; then | ||||||
|  |             if [[ "`expr match $VERSION '\(^v0\.2\.[0-2]$\)'`" != '' ]]; then | ||||||
|  |               echo "npm requires node v0.2.3 or higher" | ||||||
|  |             else | ||||||
|               curl http://npmjs.org/install.sh | clean=yes npm_install=0.2.19 sh |               curl http://npmjs.org/install.sh | clean=yes npm_install=0.2.19 sh | ||||||
|  |             fi | ||||||
|           else |           else | ||||||
|             curl http://npmjs.org/install.sh | clean=yes sh |             curl http://npmjs.org/install.sh | clean=yes sh | ||||||
|           fi |           fi | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user