2015-07-13 52 views
2

我使用how-to-npm來學習一些基本的npm命令。其中一個練習是爲模塊添加標籤。我運行下面的命令:npm dist-tag add [email protected] ["hello"],並運行到以下錯誤:npm不讓我添加標籤

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 ] 

這可能是有益的,包括我的package.json文件以及:

{ 
    "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" 
    } 
} 
+1

有可能是一個錯誤,如何對NPM,順便說一句。 https://github.com/nodeschool/discussions/issues/995 https://github.com/npm/how-to-npm/commit/d75557b7d201c92ba88bc07752fb81427738b3b4 –

回答

4

這是有點晚了,但要確保你使用完整的pkg名稱,不要忘記@。正如在npm dist-tag add @stevenxl/[email protected] ["hello"]