Comments (30)
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:
- Enter "npm ls" command and hit enter to get the correct user and module names along with version number
- The first line it returns should be something like this @randy/[email protected] /home/ubuntu/workspace
- Take the part from the beginning through the version number and enter the following command: npm dist-tag add @randy/[email protected] test (test is the tag name)
- It should return +test: @randy/[email protected]
- Run how-to-npm verify command and it should pass
from how-to-npm.
I had some problems with npm ls
because it didn't list me out full name as @RandyDavis mentioned above. But there is solution for that.
Open your package.json file and look for name
and version
.
Here you can see them on the beginning of package.json
file.
And you write:
npm dist-tag add @dayfiri/[email protected] what
Where @dayfiri/dev_env
is my name in package.json,
0.0.2
is version from package.json file also,
and what
is [tag] name. Tag name is your choice what you wanna write.
from how-to-npm.
I just figured it out. Should have typed
npm dist-tag add @buck/[email protected] tttt
Instead, I typed
npm dist-tag add [email protected] tttt
from how-to-npm.
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.
from how-to-npm.
After a dozen failures, I got it to work by restarting the exercise and using 'npm dist-tag add @smashzen/[email protected] newt' (following the mckenna formula above).
from how-to-npm.
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:
npm dist-tag add @mpmckenna8/[email protected] what
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.
from how-to-npm.
I couldn't get this to work either so I edited /.config/how-to-npm/registry/my_package_name/body.json
and manually included my own tag in 'dist-tags' section. Then ran how-to-npm verify
and it gave me a success message. I had to delete the tag and change the 'latest' version for the next challenge manually too. Not really a fix but at least it says completed now...
from how-to-npm.
I had this same bug. What I did is:
- npm ls //to find out my root dir is: @gooretzka/[email protected]
- npm dist-tag add @gooretzka/[email protected] beta
It worked.
from how-to-npm.
I'm having issues with this one as well.
from how-to-npm.
Same here too!
from how-to-npm.
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
from how-to-npm.
@buck-yeh can you elaborate what was "buck" and "pkg" in your case? I am facing the same issue.
from how-to-npm.
@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 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.
from how-to-npm.
@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.
from how-to-npm.
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:
return _403(req, res, { error: 'invalid version' })
137–9:
return _403(req, res, { error: 'You may not have a dist tag that is also a valid version' })
143–145:
return _403(req, res, { error: 'Tag points at invalid version: ' + dt + ' -> ' + ver })
from how-to-npm.
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:
return _403(req, res, { error: 'invalid version' })
137–9:
return _403(req, res, {
error: 'You may not have a dist tag that is also a valid version'
})
143–145:
return _403(req, res, {
error: 'Tag points at invalid version: ' + dt + ' -> ' + ver
})
—Reply to this email directly or view it on GitHub.
from how-to-npm.
+1
This part of the tutorial is very confusing and doesn't do much to help explain how to use dist-tag effectively. I'm sure others have got it to work, but I couldn't.
from how-to-npm.
I am having the same problem here. Tried repeat last two steps and avoid any irrelevant command, still no luck.
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/Users/Maggie/npm-global/bin/npm', 'dist-tag', 'ls' ]
2 info using [email protected]
3 info using [email protected]
4 silly mapToRegistry name xiaojingling
5 silly mapToRegistry using default registry
6 silly mapToRegistry registry http://localhost:15443/
7 silly mapToRegistry uri http://localhost:15443/xiaojingling
8 verbose request uri http://localhost:15443/-/package/xiaojingling/dist-tags
9 verbose request always-auth set; sending authorization
10 info attempt registry request try #1 at 3:37:28 PM
11 verbose request id 8e9018f190ad3d49
12 http request GET http://localhost:15443/-/package/xiaojingling/dist-tags
13 http 404 http://localhost:15443/-/package/xiaojingling/dist-tags
14 verbose headers { 'content-type': 'application/json',
14 verbose headers date: 'Sat, 11 Jul 2015 22:37:28 GMT',
14 verbose headers connection: 'keep-alive',
14 verbose headers 'transfer-encoding': 'chunked' }
15 error dist-tag ls Couldn't get dist-tag data for xiaojingling
16 verbose stack Error: missing : -/package/xiaojingling/dist-tags
16 verbose stack at CachingRegistryClient.<anonymous> (/Users/Maggie/npm-global/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:247:14)
16 verbose stack at Request._callback (/Users/Maggie/npm-global/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:170:14)
16 verbose stack at Request.self.callback (/Users/Maggie/npm-global/lib/node_modules/npm/node_modules/request/request.js:197:22)
16 verbose stack at Request.emit (events.js:110:17)
16 verbose stack at Request.<anonymous> (/Users/Maggie/npm-global/lib/node_modules/npm/node_modules/request/request.js:1050:14)
16 verbose stack at Request.emit (events.js:129:20)
16 verbose stack at IncomingMessage.<anonymous> (/Users/Maggie/npm-global/lib/node_modules/npm/node_modules/request/request.js:996:12)
16 verbose stack at IncomingMessage.emit (events.js:129:20)
16 verbose stack at _stream_readable.js:908:16
16 verbose stack at process._tickCallback (node.js:355:11)
17 verbose statusCode 404
18 verbose cwd /Users/Maggie/howtonpm-workshop
19 error Darwin 14.3.0
20 error argv "node" "/Users/Maggie/npm-global/bin/npm" "dist-tag" "ls"
21 error node v0.12.0
22 error npm v2.13.0
23 error code E404
24 error 404 missing : -/package/xiaojingling/dist-tags
25 verbose exit [ 1, true ]
from how-to-npm.
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.
404 missing : -/package/@iuvbio%2fhow-to-npm/dist-tags
from how-to-npm.
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:
- Delete the project folder in which you last used for your workshop.
- Empty your trash folder. (Because Ubuntu derivatives possibly the 'HOW-TO-NPM' a dirty link created to the Trash. That already happened to me too.)
- Reset the Workshop with: how-to-npm reset
- Create again a new folder for your how-to-npm workshop.
- Start again your project. However possible tidy.
Good luck!
from how-to-npm.
@Silerra I've done this as well and I'm still getting the same error...
from how-to-npm.
I've run into the same problem as above.
Aborting this chapter due to stuff like this.
from how-to-npm.
^^ This. After many a fail myself, I finally got this to work for me. Thank you smashzen. Good vibes
from how-to-npm.
@denmch @buck-yeh @mpmckenna8 thanks, using fully qualified module names did the trick!
from how-to-npm.
@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 npm publish
, without getting errors thrown, yet it is necessary in order to get the tests to pass. It is not just a problem of tests not passing, the command simply WILL NOT RUN in Step 11, so you must go to one of the Publish steps, npm publish tag=something
, then return to Step 11, and run how-to-npm verify. This sucked up almost 2 hours of my day. I hope this post helps other people understand the problem quicker.
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.
from how-to-npm.
closing for #45
from how-to-npm.
Thanks @RandyDavis . Your solution worked for me and was the easiest to understand of the all the suggested solutions.
from how-to-npm.
Thank you @RandyDavis. I completely agree with mgrezzy. It's the best explanation. Pity that after 2hours strugling i found this explanation. THX
from how-to-npm.
@RandyDavis Thank you so much for explaining that even further. It has helped alot and I really appreciate it dude.
from how-to-npm.
ronin:/workspace/fcc $ npm dist-tag add @ronin/[email protected] beta/workspace/fcc $ npm ls
+beta: @ronin/[email protected]
ronin:
@ronin/[email protected] /home/ubuntu/workspace/fcc
└── @linclark/[email protected]
ronin:~/workspace/fcc $ 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.
from how-to-npm.
Related Issues (20)
- Update the label names HOT 1
- Pull request #108 rolls back fix #57 HOT 5
- Incorrectly reports wrong folder on windows due to case sensitivity HOT 1
- Version checking issue with "00 Install npm" exercise HOT 3
- how-to-npm HOT 2
- Very basic NPM newbie question HOT 2
- Cannot publish HOT 2
- npm publish needs a paid account HOT 3
- Renew the problems to support npm@5
- Error, when trying to reset registry HOT 3
- when I type how-to-npm in terminal It gives me the following error HOT 2
- Challenge 00: doesn't tell you how to check version HOT 1
- npm-init fails in Dev Enviroment
- No outdated packages ... HOT 1
- "npm install <package-name>" better than "npm install <module-name>"
- should keep bundleDependencies in package.json? HOT 1
- no such file or directory, chmod '/usr/local/lib/node_modules/how-to-npm/node_modules/mkdirp/bin/cmd.js' HOT 7
- Error: Cannot find module 'workshopper-adventure/adventure' HOT 2
- npm adduser -> Error: code ENYI Web login not supported
- Is this repository still being maintained in 2023? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from how-to-npm.