-
Notifications
You must be signed in to change notification settings - Fork 221
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
npm dist add not working #21
Comments
I'm having issues with this one as well. |
Same here too! |
This actually does work. See this note on FreeCodeCamp's implementation of how-to-npm for details about the bug and how to avoid it: freeCodeCamp/freeCodeCamp#758 |
I just figured it out. Should have typed |
@buck-yeh can you elaborate what was "buck" and "pkg" in your case? I am facing the same issue. |
@gautammadaan 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 In other words, you may need to go back two steps to use 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. |
@denmch Thanks a lot of that. Yes you are right! The part of the tutorial that didn't work for me was "npm publish" and so it was throwing up errors later on in the tutorial. |
I still consider this a bug, because It looks to me that something is broken around the error messages, I see these errors related to dist tags in 126: 137–9: 143–145: |
I agree. I consider this about alsoJosh CSent from Yahoo Mail for iPhoneAt Jun 5, 2015, 5:06:12 PM, Den McHenry wrote:I still consider this a bug, because npm dist-tag ls lists the erroneous dist tags even though they were invalid. And once you make this mistake, the dist-tag portion of the tutorial becomes unusable and how-to-npm must be restarted. It looks to me that something is broken around the error messages, I see these errors related to dist tags in registry.js but they don't seem to come up when you commit the errors: 126: 137–9: 143–145: —Reply to this email directly or view it on GitHub. |
+1 |
I am having the same problem here. Tried repeat last two steps and avoid any irrelevant command, still no luck.
|
I was getting the same 404 error and couldn't figure out what was wrong because if typed as above it will work for regular modules but not in our how-to-npm dev environment. To finally get it to work I used: Where the reference to the module starts with the @username/moduleName/version and in this case the dist-tag to add is what. Making this syntax explicit in the lesson text would probably be useful. |
same problem here. repeated the last two steps, I have three versions (1.0.0, 1.0.1, 1.0.2), all of them are definitely published. I have tried the syntax @mpmckenna8 proposed and the "normal" one without the username, but both didn't work.
|
I recently had the same problem. I can't understand why the step "Dist Tag" fails when the "npm publish" had previously failed once. Then I have tried different ways to go about this bug out of the way. Finally helped me only the following steps:
Good luck! |
@Silerra I've done this as well and I'm still getting the same error... |
I've run into the same problem as above. Aborting this chapter due to stuff like this. |
After a dozen failures, I got it to work by restarting the exercise and using 'npm dist-tag add @smashzen/smashproject@1.0.0 newt' (following the mckenna formula above). |
^^ This. After many a fail myself, I finally got this to work for me. Thank you smashzen. Good vibes |
@denmch @buck-yeh @mpmckenna8 thanks, using fully qualified module names did the trick! |
I couldn't get this to work either so I edited |
@denmch thank you. I really cannot stress enough the importance of this line: "The solution is to run how-to-npm again and, if necessary, repeat the previous step (or steps)." This is NOT MENTIONED in the tutorial. In particular, on Step 11 (Dist Tag Removal) it seems to be impossible to run If you are getting confusing errors, try to return to a step in the tutorial where the command worked, and run the command again. P.S. @denmch , perhaps you can add a note to this effect in the instructions on the FreeCodeCamp waypoint for this? I appreciate the note about only applying tags to versions that have been published, but this error situation seems way more common and confusing. |
closing for #45 |
I was having pretty much all of the issues as everyone above and definitely was thinking that I was not doing something right and then I did the following and it worked:
|
Thanks @RandyDavis . Your solution worked for me and was the easiest to understand of the all the suggested solutions. |
Thank you @RandyDavis. I completely agree with mgrezzy. It's the best explanation. Pity that after 2hours strugling i found this explanation. THX |
It seems once you get into the 404 erros there's not a simple way back, i tried init the project again, doing ls to see the correct name of the project, nothing worked, an entry level tutorial should not be this fragile, and its ridiculous this is closed. |
I had some problems with Here you can see them on the beginning of Where |
@RandyDavis Thank you so much for explaining that even further. It has helped alot and I really appreciate it dude. |
Numerous people were running into issues with the instructions for problem 11 - adding a dist tag see workshopper#21 I changed the wording of the instructions to show people how to figure out the package and version of a project.
Numerous people were running into issues with the instructions for problem 11 - adding a dist tag see workshopper#21 I changed the wording of the instructions to show people how to figure out the package and version of a project. Fixed typos
I had this same bug. What I did is:
|
ronin: ronin:~/workspace/fcc $ how-to-npm verify
|
this is my command i keep trying to run and it won't work. npm dist-tag add test@1.0.1 latest
here is the log:
0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'dist-tag',
1 verbose cli 'add',
1 verbose cli 'test@1.0.1',
1 verbose cli 'latest' ]
2 info using npm@2.7.3
3 info using node@v0.12.0
4 verbose node symlink /usr/local/bin/node
5 verbose dist-tag add latest to test@1.0.1
6 silly mapToRegistry name test
7 silly mapToRegistry using default registry
8 silly mapToRegistry registry http://localhost:15443/
9 silly mapToRegistry uri http://localhost:15443/test
10 verbose request uri http://localhost:15443/-/package/test/dist-tags
11 verbose request no auth needed
12 info attempt registry request try #1 at 11:53:24
13 verbose request id 62b5673de17b3467
14 http request GET http://localhost:15443/-/package/test/dist-tags
15 http 404 http://localhost:15443/-/package/test/dist-tags
16 verbose headers { 'content-type': 'application/json',
16 verbose headers date: 'Tue, 05 May 2015 16:53:24 GMT',
16 verbose headers connection: 'keep-alive',
16 verbose headers 'transfer-encoding': 'chunked' }
17 verbose stack Error: missing : -/package/test/dist-tags
17 verbose stack at CachingRegistryClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:254:14)
17 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:178:14)
17 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:344:22)
17 verbose stack at Request.emit (events.js:110:17)
17 verbose stack at Request. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1239:14)
17 verbose stack at Request.emit (events.js:129:20)
17 verbose stack at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1187:12)
17 verbose stack at IncomingMessage.emit (events.js:129:20)
17 verbose stack at _stream_readable.js:908:16
17 verbose stack at process._tickCallback (node.js:355:11)
18 verbose statusCode 404
19 verbose cwd /Applications/NODEJS/howtonpm
20 error Darwin 14.3.0
21 error argv "node" "/usr/local/bin/npm" "dist-tag" "add" "test@1.0.1" "latest"
22 error node v0.12.0
23 error npm v2.7.3
24 error code E404
25 error 404 missing : -/package/test/dist-tags
26 verbose exit [ 1, true ]
The text was updated successfully, but these errors were encountered: