I’m working on the how-to-npm tutorial and on the step Dist Tag I can’t seem to get the dist tag added properly.
I have tried countless different variations of the solution recommended on cloud9 forums
npm dist-tag add @{username}/{package name}@{version number} {tag}
as well as many variations of the supplied documentation
npm dist-tag add @linclark/pkg@1.0.1 beta
npm dist-tag add linclark@1.0.1 beta
npm dist-tag add pkg@1.0.1 beta
npm dist-tag add @username/linclark@1.1.0 [“beta”]
npm dist-tag add @username /linclark/pkg@1.0.1 [beta]
and no matter if the command succeeds and I get
+[beta]: @linclark/pkg@1.0.1
or the command results in one of the following errors
npm ERR! code E404
npm ERR! 404 missing : -/package/@username%2flinclark/dist-tags
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2017-08-16T13_33_06_978Z-debug.log
when I check to see if it’s added using npm dist-tag ls there’s only one dist-tag and the how-to-npm verify check will fail
Any help completing this would be greatly appreciated.
In my case the correct form was (as recommended on cloud9):
npm dist-tag add @{username}/{package name}@{version number} {tag}.
Just make sure to insert the correct values that you can see typing “npm ls” command:
- {username} is your “fake” username that you typed when asked for it;
- {package name} is the name of your package (the one generated by you for the exercise)
- {tag} is a string without any other character (in you example just beta)
I think “npm dist-tag add <pkg>@<version> [<tag>]` will add a new tag.” as explained in the exercise, is an error.
2 Likes
Thank you very much for the responses. I still can’t seem to get the verification to work.
My user name is codereese and the package is @linclark/pkg
taken from package.json
“dependencies”: {
"@linclark/pkg": “^1.0.2”
},
I tried the command
npm dist-tag add @codereese/@linclark/pkg@1.1.0 beta
I tried every possible variation of this, with the @ in front of linclark, with the pkg, with the /pkg, and every other sort of possibility including version 1.0.2 and none seem to work.
I also tried npm dist-tag add @foo/how-to-npm@1.1.0 beta replacing foo with my name and that didn’t work either
Section “dependencies” in package.json contains reference to other packages you previously installed and you intend to use in your project.
Take a look at the first row in that file, you would see your user and package names.
For instance, in my file I have this line:
"name": "@thefakeuser/how-to-npm",
Where the string “thefakeuser” is username I created for the exercise and the string “how-to-npm” is the package name.
So, to add the tag “beta” to my package (version 1.0.1) I had to use this command:
npm dist-tag add @thefakeuser/how-to-npm@1.0.1 beta
The walkthrough posted by SkyC is simple to follow and can help you to complete the challenge.
I hope you can quickly go on with this and the other challenges.
Do not feel discouraged and never give up.
Thank you very much, I got it to work.