how-to-npm issues are mostly human error compounded by an annoying bug
See original GitHub issueChallenge http://www.freecodecamp.com/challenges/waypoint-manage-packages-with-npm.
The dist-tag bug in how-to-npm 2.0.0 is trivial if you know the cause and how to deal with it. The bug is actually triggered entirely by human error: e.g., if you try to add or remove an invalid dist-tag, 403 or 404 errors will begin to accumulate. The tutorial should have delivered a descriptive error message in these cases.
If at any point you see a 403 or 404 error your only recourse is to run how-to-npm
again, and in some cases you may need to repeat a prior step.
Here are some common causes for these errors;
- Try not to use commands out of sequence. For example, avoid using
npm publish
on steps that do not ask you to publish. Even if you enter a valid npm command, the tutorial will often break if you do things it isn’t expecting for a given test. If you need to repeat a command, you may be better off returning to the relevant test before picking up at your current step. npm version
should be followed by a version number (e.g., 1.0.2) or by a keyword indicating a semver type (e.g., ‘patch’). Seenpm help version
for examples. (You may also set the version number manually in package.json, butnpm version
works if you understand the syntax.)- You can not change the
dist-tag
of the version taggedlatest
until you’ve assignedlatest
to a different version. dist-tags
can not be added to a version number beyond the highest existing version. For example, if you’ve set and published version 2.0.0, you can not add a dist-tag to 2.0.1.- Finally, if you set
latest
to a low number (e.g., 0.0.1) you’re eliminating or vastly reducing the available version numbers to which you can assign dist-tags.
Any of these (and more like them) will cause 403 or 404 errors and will require users to step back, rerun how-to-npm
, and be careful not to repeat mistakes.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:25 (7 by maintainers)
Top GitHub Comments
The problem with this entire set is that it’s designed to teach by guessing. Please make simple and clear instructions in a tutorial. Don’t TRY to fool students by leaving the solution out of the lesson. I still don’t know how to tell the name of my package or what the function of a package or dependency actually is.
This is actually ridiculous and I cannot pass it no matter what I have done. I skipped the entire challenge after it would NOT work the 1000 different things I tried, I have spent 3 hours on this.