Steven L.
Steven L.

Reputation: 2155

npm not letting me add a tag

I am using the how-to-npm to learn a few basic npm commands. One of the exercises is to add a tag to a module. I am running the following command: npm dist-tag add [email protected] ["hello"], and run into the following error:

0 info it worked if it ends with ok
1 verbose cli [ 'node',
1 verbose cli   '/home/ubuntu/.nvm/v0.10.35/bin/npm',
1 verbose cli   'dist-tag',
1 verbose cli   'add',
1 verbose cli   '[email protected]',
1 verbose cli   '[hello]' ]
2 info using [email protected]
3 info using [email protected]
4 verbose dist-tag add [hello] to [email protected]
5 silly mapToRegistry name learnyounode
6 silly mapToRegistry using default registry
7 silly mapToRegistry registry http://localhost:15443/
8 silly mapToRegistry uri http://localhost:15443/learnyounode
9 verbose request uri http://localhost:15443/-/package/learnyounode/dist-tags
10 verbose request no auth needed
11 info attempt registry request try #1 at 01:58:44
12 verbose request id 73911a3da82ac8b0
13 http request GET http://localhost:15443/-/package/learnyounode/dist-tags
14 http 404 http://localhost:15443/-/package/learnyounode/dist-tags
15 verbose headers { 'content-type': 'application/json',
15 verbose headers   date: 'Mon, 13 Jul 2015 01:58:44 GMT',
15 verbose headers   connection: 'keep-alive',
15 verbose headers   'transfer-encoding': 'chunked' }
16 verbose stack Error: missing : -/package/learnyounode/dist-tags
16 verbose stack     at CachingRegistryClient.<anonymous> (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:247:14)
16 verbose stack     at Request._callback (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:170:14)
16 verbose stack     at Request.self.callback (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/npm/node_modules/request/request.js:197:22)
16 verbose stack     at Request.emit (events.js:98:17)
16 verbose stack     at Request.<anonymous> (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/npm/node_modules/request/request.js:1050:14)
16 verbose stack     at Request.emit (events.js:117:20)
16 verbose stack     at IncomingMessage.<anonymous> (/home/ubuntu/.nvm/v0.10.35/lib/node_modules/npm/node_modules/request/request.js:996:12)
16 verbose stack     at IncomingMessage.emit (events.js:117:20)
16 verbose stack     at _stream_readable.js:944:16
16 verbose stack     at process._tickCallback (node.js:442:13)
17 verbose statusCode 404
18 verbose cwd /home/ubuntu/workspace/learnyounode
19 error Linux 3.14.13-c9
20 error argv "node" "/home/ubuntu/.nvm/v0.10.35/bin/npm" "dist-tag" "add" "[email protected]" "[hello]"
21 error node v0.10.35
22 error npm  v2.13.0
23 error code E404
24 error 404 missing : -/package/learnyounode/dist-tags
25 verbose exit [ 1, true ]

It might be instructive to include my package.json file as well:

{
  "name": "@stevenxl/learnyounode",
  "version": "1.1.0",
  "description": "Testing",
  "main": "baby_steps.js",
  "repository": "www.google.com",
  "scripts": {
    "test": "node test.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@linclark/pkg": "^1.0.3"
  }
}

Upvotes: 2

Views: 2196

Answers (1)

Joseph Rimar
Joseph Rimar

Reputation: 81

This is a little late but make sure you use the full pkg name and don't forget the @. As in npm dist-tag add @stevenxl/[email protected] ["hello"]

Upvotes: 5

Related Questions