workshopper / how-to-npm

A module to teach you how to module.
https://www.npmjs.com/package/how-to-npm
ISC License
1.09k stars 212 forks source link

Add Dist Tag How to npm #72

Closed nirmalrizal closed 7 years ago

nirmalrizal commented 7 years ago

nirmalrizal:~/workspace (master) $ npm dist-tag add npm-codecamp@1.0.1 ["npm-nodecamp"] npm ERR! Linux 4.2.0-c9 npm ERR! argv "/home/ubuntu/.nvm/versions/node/v4.5.0/bin/node" "/home/ubuntu/.nvm/versions/node/v4.5.0/bin/npm" "dist-tag" "add" "npm-codecamp@1.0.1" "[npm-nodecamp]" npm ERR! node v4.5.0 npm ERR! npm v3.10.7 npm ERR! code E404

npm ERR! 404 missing : -/package/npm-codecamp/dist-tags

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

ThomasG77 commented 7 years ago

When you read the npm help dist-tag you see npm dist-tag add <pkg>@<version> [<tag>] The [] around means it's optional (it will tag latest) Try instead

npm dist-tag add npm-codecamp@1.0.1 npm-nodecamp
BrandonSM commented 7 years ago

I also tried adding via the following command and got the same error as the original poster. Using sudo as I haven't fixed the permission problem with npm.

sudo npm dist-tag add how-to-npm-tutorial@1.0.1 how-to-npm-tutorial

When using just "npm dist-tag add how-to-tutorial-npm@1.0.1 how-to-npm-tutorial", it gives me a message about just Usage: npm like it doesn't recognize the command.

What am I missing?

ThomasG77 commented 7 years ago

Just read https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md if you have a global Node otherwise, just use NVM using this recipe

dy20082250 commented 7 years ago

npm dist-tag add easy_test@0.0.3 test_for_tag

npm ERR! 404 missing : -/package/easy_test/dist-tags

npm ERR! Please include the following file with any support request: npm ERR! /Users/wdy/Documents/npmtest/npm-debug.log

the below is the content of npm-debug.log:

0 info it worked if it ends with ok 1 verbose cli [ '/usr/local/Cellar/node/6.1.0/bin/node', 1 verbose cli '/usr/local/bin/npm', 1 verbose cli 'dist-tag', 1 verbose cli 'add', 1 verbose cli 'easy_test@0.0.3', 1 verbose cli 'test_for_tag' ] 2 info using npm@3.8.6 3 info using node@v6.1.0 4 verbose dist-tag add test_for_tag to easy_test@0.0.3 5 silly mapToRegistry name easy_test 6 silly mapToRegistry using default registry 7 silly mapToRegistry registry http://localhost:15443/ 8 silly mapToRegistry data Result { 8 silly mapToRegistry raw: 'easy_test', 8 silly mapToRegistry scope: null, 8 silly mapToRegistry name: 'easy_test', 8 silly mapToRegistry rawSpec: '', 8 silly mapToRegistry spec: 'latest', 8 silly mapToRegistry type: 'tag' } 9 silly mapToRegistry uri http://localhost:15443/easy_test 10 verbose request uri http://localhost:15443/-/package/easy_test/dist-tags 11 verbose request no auth needed 12 info attempt registry request try #1 at 9:46:25 PM 13 verbose request id 3d0d0fb0622bc8bf 14 http request GET http://localhost:15443/-/package/easy_test/dist-tags 15 http 404 http://localhost:15443/-/package/easy_test/dist-tags 16 verbose headers { 'content-type': 'application/json', 16 verbose headers date: 'Sat, 08 Oct 2016 13:46:25 GMT', 16 verbose headers connection: 'keep-alive', 16 verbose headers 'content-length': '19' } 17 verbose stack Error: missing : -/package/easy_test/dist-tags 17 verbose stack at makeError (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:264:12) 17 verbose stack at CachingRegistryClient. (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:252:14) 17 verbose stack at Request._callback (/usr/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:172:14) 17 verbose stack at Request.self.callback (/usr/local/lib/node_modules/npm/node_modules/request/request.js:199:22) 17 verbose stack at emitTwo (events.js:106:13) 17 verbose stack at Request.emit (events.js:191:7) 17 verbose stack at Request. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:1036:10) 17 verbose stack at emitOne (events.js:101:20) 17 verbose stack at Request.emit (events.js:188:7) 17 verbose stack at IncomingMessage. (/usr/local/lib/node_modules/npm/node_modules/request/request.js:963:12) 18 verbose statusCode 404 19 verbose cwd /Users/wdy/Documents/npmtest 20 error Darwin 15.5.0 21 error argv "/usr/local/Cellar/node/6.1.0/bin/node" "/usr/local/bin/npm" "dist-tag" "add" "easy_test@0.0.3" "test_for_tag" 22 error node v6.1.0 23 error npm v3.8.6 24 error code E404 25 error 404 missing : -/package/easy_test/dist-tags 26 verbose exit [ 1, true ]

could you give some advice? I have tried all the methods,including the above two

C-F-4 commented 7 years ago

69 is the same issue. I'm not sure exactly what's wrong with it. But it's the both exercises on Dist Tag and hence Dist Tag Removal that can't be finished, and need to be updated.

BrunoWilkinson commented 7 years ago

Hello everyone,

I see this issue is still open, I manage to pass the two dist-tag exercises.

So first you want to got to your package.json file, then copy the name value (the name of module). For example:

{
  "name": "@user/nameOfModule", 
  "version": "1.0.1",
  "main": "index.js",
  "scripts": {
    "test": "node test.js"
  },

copy the line called name (it won't be same and only the value! without "name": )

After you copied the correct name to add the the tag too, use this command:

npm dist-tag add <copied named from package.json>@1.0.1 beta

For the second exercise of dist-tag remove use this commands:

npm dist-tag rm <copied named from package.json>@1.0.1 beta

And to point the "Latest" tag to a different version use this command:

npm dist-tag add <copied named from package.json>@1.0.0

I hope this helps :)

watilde commented 7 years ago

Thanks all for following up on this issue! I think the solution has been already posted on the above like @BrunoWilkinson posted. I will close this as resolved, and please do not hesitate to open it again if you still can't fix it!

murtaza63 commented 6 years ago

{ "name": "@murtaza23/workspace", "version": "1.0.2", "description": ",-----.,--. ,--. ,---. ,--.,------. ,------. ' .--./| | ,---. ,--.,--. ,-| || o \ | || .-. \ | .---' | | | || .-. || || |' .-. |..' | | || | \\ :|--, ' '--'\| |' '-' '' '' '\ -' | .' / | || '--' /|---. -----'--' ---'----' ---'--' --'-------' `------' -----------------------------------------------------------------", "main": "server.js", "dependencies": { "@linclark/pkg": "^1.0.2" }, "devDependencies": {}, "scripts": { "test": "node test.js", "start": "node server.js" }, "author": "", "license": "ISC", "repository": { "type": "git", "url": "git://github.com/murtaza63/repository.git" }, "bugs": { "url": "https://github.com/murtaza63/repository/issues" }, "homepage": "https://github.com/murtaza63/repository#readme" }

I adding dist-tag with this command $ npm dist-tag add @linclark/pkg@1.0.2 beta and verify with this command $ how-to-npm verify but terminal shows this Uh oh, looks like you still only have a single dist-tag. Use npm help dist-tag to learn how to add another one. I am new back end please help me how to add dist tag off free code challange

ankur01oct commented 6 years ago

C:\NodeApp\howtonpm>npm ls @ankur01oct/howtonpm@1.0.1 C:\NodeApp\howtonpm -- @linclark/pkg@1.0.2

copy '@ankur01oct/howtonpm@1.0.1'

it works!!! C:\NodeApp\howtonpm>npm dist-tag add @ankur01oct/howtonpm@1.0.1 beta +beta: @ankur01oct/howtonpm@1.0.1 `