workshopper / how-to-npm

A module to teach you how to module.
https://www.npmjs.com/package/how-to-npm
ISC License
1.09k stars 212 forks source link

Version checking issue with "00 Install npm" exercise #115

Open mark-walle opened 7 years ago

mark-walle commented 7 years ago

Encountered a mistake with the first exercise where it believes an older version of npm is later than my current version:

> how-to-npm verify
verifying that npm is installed...
You have version 4.1.2 installed.  Great!
Now let's see what the latest version is... wait for it...
The latest npm is: 4.4.1
You have version 4.1.2, but the latest is 4.4.1
Run `npm install npm -g` to upgrade it
(You can also just skip this if you want)
mark-walle commented 7 years ago

I just changed to 4.4.1 in order to complete the workshop, but maybe how-to-npm should allow pre-releases to pass, or give explicit directions to not use pre-release versions.

watilde commented 7 years ago

thanks for reporting this! I think it's just a logic bug in a code: https://github.com/workshopper/how-to-npm/blob/master/problems/00-install-npm/index.js#L53

I'm gonna fix it.

myintmyatkyu commented 6 years ago

Hi I got this error when I run how-to-npm verify at "00 install npm" exercise I have passed all other exercises except this one. Thanks

how-to-npm verify verifying that npm is installed... You have version 6.0.1 installed. Great! Now let's see what the latest version is... wait for it... The latest npm is: /home/ec2-user/.nvm/versions/node/v6.14.1/lib/node_modules/how-to-npm/node_modules/semver/semver.js:295 throw new TypeError('Invalid Version: ' + version); ^

TypeError: Invalid Version: at new SemVer (/home/ec2-user/.nvm/versions/node/v6.14.1/lib/node_modules/how-to-npm/node_modules/semver/semver.js:295:11) at compare (/home/ec2-user/.nvm/versions/node/v6.14.1/lib/node_modules/how-to-npm/node_modules/semver/semver.js:571:10) at Function.gt (/home/ec2-user/.nvm/versions/node/v6.14.1/lib/node_modules/how-to-npm/node_modules/semver/semver.js:600:10) at /home/ec2-user/.nvm/versions/node/v6.14.1/lib/node_modules/how-to-npm/problems/00-install-npm/index.js:53:18 at ChildProcess.exithandler (child_process.js:190:7) at emitTwo (events.js:106:13) at ChildProcess.emit (events.js:191:7) at maybeClose (internal/child_process.js:920:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)