Freecodecamp: how-to-npm: issues adding dist-tag & verify skip not working either

Created on 5 Jul 2016  路  7Comments  路  Source: freeCodeCamp/freeCodeCamp

I am aware that this was an issue in the past and have reviewed those conversations, specifically denmch's posts on May 30, 2015

I have completed all of jlord's git-it and some of learn-you-node without any problems

Challenge Name

Manage Packages with npm

https://www.freecodecamp.com/challenges/manage-packages-with-npm (#13)

Issue Description

On step 11 of how-to-npm

Browser Information

  • Browser Name: Google Chrome
  • Operating System: Windows
  • Mobile, Desktop, or Tablet: desktop

    Your Code

I've tried

aghafour:~/workspace/how-to-npm (master) $ npm dist-tag add [email protected] [buggy]

which gives

npm ERR! Linux 4.2.0-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.4.5/bin/node" "/home/ubuntu/.nvm/versions/node/v4.4.5/bin/npm" "dist-tag" "add" "[email protected]" "[buggy]"
npm ERR! node v4.4.5
npm ERR! npm  v3.10.3
npm ERR! code E404

npm ERR! 404 missing : -/package/fcc-learning/dist-tags

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ubuntu/workspace/how-to-npm/npm-debug.log

I've also tried variations of the initial command, the corresponding dist-tag ls command (which returns same errors), going back and redoing the publish and republish levels, making sure that the version I'm trying to do isn't the latest, and adding a "dist-tags" property of "buggy" to my package.json object (total hail mary based off the ERR! 404 missing: from above)

how-to-npm verify skip isn't working either. Can anyone help me?

Most helpful comment

I went back to look through this as I originally stopped at the dist-tag step. Turns out, it does work but is very picky. See the post here from wayback regarding this issue: https://github.com/FreeCodeCamp/FreeCodeCamp/issues/758

I recommend going back to the "Start A Project" step, and redoing npm init as my package did not have my username in the name: area of the package.json. When I was getting the error you got, the name was "fccproject", but when I re-did npm init, it changed it to @dhcodes/fccproject. I was then able to re-run the publish step. For the version step, as noted in #758, be sure to add a new version number (ex. npm version 1.0.x where x is incremented +1) even though the directions aren't clear on this. Then verify and do publish again. And verify that.

Finally, when dealing with the dist-tag, know that the syntax should be: npm dist-tag add @yourusername/[email protected] test where you change it to match your username and your pkg name and change x to be your version number from _publish_, NOT publish again--since you can't add a dist-tag to the latest release. To confirm the details of your pkg, you can run npm ls to see your username and package name.

Lastly, npm dist-tag ls can help with the task to remove dist-tags. Best of luck!

All 7 comments

+1 on this. I couldn't get it working. I ended up having to skip it with a view of raising an issue, but I never got round to it.

I went back to look through this as I originally stopped at the dist-tag step. Turns out, it does work but is very picky. See the post here from wayback regarding this issue: https://github.com/FreeCodeCamp/FreeCodeCamp/issues/758

I recommend going back to the "Start A Project" step, and redoing npm init as my package did not have my username in the name: area of the package.json. When I was getting the error you got, the name was "fccproject", but when I re-did npm init, it changed it to @dhcodes/fccproject. I was then able to re-run the publish step. For the version step, as noted in #758, be sure to add a new version number (ex. npm version 1.0.x where x is incremented +1) even though the directions aren't clear on this. Then verify and do publish again. And verify that.

Finally, when dealing with the dist-tag, know that the syntax should be: npm dist-tag add @yourusername/[email protected] test where you change it to match your username and your pkg name and change x to be your version number from _publish_, NOT publish again--since you can't add a dist-tag to the latest release. To confirm the details of your pkg, you can run npm ls to see your username and package name.

Lastly, npm dist-tag ls can help with the task to remove dist-tags. Best of luck!

As a follow-up, I don't see this as an issue with FCC so much as poor wording from how-to-npm and possibly an issue on their end. Luckily, there are many github issues about this that led me to the eventual solution so read-search-ask does get you there assuming you can find the right discussions on github.

Great write up @dhcodes Very helpful, thanks!

edwardthawne:~/workspace $ npm dist-tag ls
npm ERR! dist-tag ls Couldn't get dist-tag data for chat-example
npm ERR! Linux 4.2.0-c9
npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.4.5/bin/node" "/home/ubuntu/.nvm/versions/node/v4.4.5/bin/npm" "dist-tag" "ls"
npm ERR! node v4.4.5
npm ERR! npm v3.10.5
npm ERR! code E404

npm ERR! 404 missing : -/package/chat-example/dist-tags

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/workspace/npm-debug.log

Followed the solution that @dhcodes described.
Then ran npm-dist-tag ls
it shows the test tag applied to an unpublished package and version 1.0.8
how-to-npm verify still fails
Added a dist-tag to version 1.0.6
then ran how-to-npm verify to pass
Please see my output below

p3nski:~/workspace/howtonpm (master) $ npm dist-tag ls
latest: 1.0.7
test: 1.0.8
p3nski:~/workspace/howtonpm (master) $ npm dist-tag add @fellfromhell/[email protected] test
+test: @fellfromhell/[email protected]
p3nski:~/workspace/howtonpm (master) $ how-to-npm verify
Congratulations! You've added a dist-tag!

This is a handy way to manage releases. For example, the npm project
itself publishes each new version as 'next' (instead of 'latest') so
that beta users can test it out before it becomes the default.

Run how-to-npm to move on to the next exercise.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@ YOUR SOLUTION IS CORRECT! @@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

I also had the same issue. tbh, I didn't try dhcodes' solution partially because I feel like this should either be fixed or not included in the lesson with such a difficult to use tutorial. I'm moving along and will hopefully just figure this out over time.

Was this page helpful?
0 / 5 - 0 ratings