Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review and improve dist-tag portion of tutorial #45

Open
ashleygwilliams opened this issue Oct 21, 2015 · 12 comments
Open

review and improve dist-tag portion of tutorial #45

ashleygwilliams opened this issue Oct 21, 2015 · 12 comments

Comments

@ashleygwilliams
Copy link
Contributor

fixes #21 #35

@ashleygwilliams
Copy link
Contributor Author

from @denmnch in #21 I spent some more time with this and narrowed it down. The real issue for most users experiencing problems with this portion of the tutorial is a misunderstanding of how versions are created and published and how dist-tags relate to them.

If you make a mistake, e.g., trying to apply a dist-tag to a version number that hasn't been published, the app throws up errors and ceases to work as expected. The solution is to run how-to-npm again and, if necessary, repeat the previous step (or steps).

In other words, you may need to go back two steps to use npm version patch (or similar) and note the version number. Then publish that version. Then use the correct syntax to add a dist-tag to the newly published version.

If you follow those steps the tutorial works perfectly. But it will continue to throw errors and fail to add dist-tags if you make a mistake or if you attempt to do certain actions on steps other than those on which they are being tested.

@ashleygwilliams
Copy link
Contributor Author

@profoundhub
Copy link

Finally figured it out, it was silly and tricky and buggy and ... sigh!

@boriskogan81
Copy link

Well, could you explain for the rest of us?

@amirghafouri
Copy link

Reviewed denmch's posts and still having trouble.

I've tried

aghafour:~/workspace/how-to-npm (master) $ npm dist-tag add fcc-learning@1.0.1 [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" "fcc-learning@1.0.1" "[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?

@dhcodes
Copy link

dhcodes commented Jul 5, 2016

@amirghafouri I posted this over on FCC but thought you might find it helpful to:

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: #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/yourpkgname@1.0.x 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!

@JohnnyBizzel
Copy link

JohnnyBizzel commented Oct 24, 2016

After several attempts now I am giving up. As a beginner tutorial this is terrible. If you have to do all the steps suggested by @dhcodes just to get though it, is it worth it? So far I haven't found any help on Stack Overflow or Cloud 9. To be honest I am just going round and round in circles. Please consider improving this challenge.
I'm stuck at trying to re-publish even after changing the version number.

@makstheimba
Copy link

makstheimba commented Nov 8, 2016

I had the same error and managed to complete this challenge after starting over and redoing all steps, only thing that changed is a package name - it became @/. Also if I ever did mistake on a how-to-npm challenge I'd rerun it. That's what worked for me.

@swyxio
Copy link

swyxio commented Nov 23, 2016

for future people encountering this issue, i had it too and zach from nodeschool/discussions#995 helped. just be crystal clear what the name of the project is. and yes really add your @username because their documentation sucks.

@Croasdell
Copy link

Hello all

this will help all of you find your own correct details so you can complete this section simply use the following

npm ls dist-tag
this will list your dist-tag info and then just use this in you command

enjoy :)

@profoundhub
Copy link

is this closed?

@ChaturvediSulabh
Copy link

ChaturvediSulabh commented Feb 9, 2018

So, the key is to find what tags do you have on your package to do so follow as mentioned below
ec2-user: $ npm dist-tag ls
latest: 1.1.0
Now, as I know that i have tag=latest on my package version 1.1.0. So, let me go and remove latest tag from my package
ec2-user:$ npm dist-tag rm PKG latest
-latest: pkg@version
latest is now pointing to 1.2.0 package version which I had simply updated in package.json file version tag
verify and all set
ec2-user: $ how-to-npm verify

Congratulations!  You're a dist-tagging pro!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants