Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

发布私有包一直不成功 #659

Closed
lfire opened this issue Sep 17, 2015 · 2 comments
Closed

发布私有包一直不成功 #659

lfire opened this issue Sep 17, 2015 · 2 comments

Comments

@lfire
Copy link

lfire commented Sep 17, 2015

自己搭好了环境,按文中所说,建好了一个helloworl,再发布,报错:
cnpm publish --registry=http://miliju.com:7001
npm ERR! publish Failed PUT 403
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\bin\npm-cli.js" "--userconfig=C:\Users\fire.cnpmrc" "--disturl=https://npm.taobao.org/mirrors/node" "--cache=C:\Users\fire.cnpm" "--registry=http://miliju.com:7001" "--node-gyp=C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\node-gyp\bin\node-gyp.js" "publish" "--registry=http://miliju.com:7001"
npm ERR! node v4.0.0
npm ERR! npm v2.14.3
npm ERR! code E403

npm ERR! no_perms Private mode enable, only admin can publish this module: helloworld
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! C:\project\node\helloworld\npm-debug.log

@lfire
Copy link
Author

lfire commented Sep 17, 2015

日志内容:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\bin\npm-cli.js',
1 verbose cli '--userconfig=C:\Users\fire.cnpmrc',
1 verbose cli '--disturl=https://npm.taobao.org/mirrors/node',
1 verbose cli '--cache=C:\Users\fire.cnpm',
1 verbose cli '--registry=http://miliju.com:7001',
1 verbose cli '--node-gyp=C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\node-gyp\bin\node-gyp.js',
1 verbose cli 'publish',
1 verbose cli '--registry=http://miliju.com:7001' ]
2 info using [email protected]
3 info using [email protected]
4 verbose publish [ '.' ]
5 silly cache add args [ '.', null ]
6 verbose cache add spec .
7 silly cache add parsed spec Result {
7 silly cache add raw: '.',
7 silly cache add scope: null,
7 silly cache add name: null,
7 silly cache add rawSpec: '.',
7 silly cache add spec: 'C:\project\node\helloworld',
7 silly cache add type: 'directory' }
8 verbose addLocalDirectory C:\Users\fire.cnpm\helloworld\1.0.0\package.tgz not in flight; packing
9 verbose tar pack [ 'C:\Users\fire.cnpm\helloworld\1.0.0\package.tgz',
9 verbose tar pack 'C:\project\node\helloworld' ]
10 verbose tarball C:\Users\fire.cnpm\helloworld\1.0.0\package.tgz
11 verbose folder C:\project\node\helloworld
12 info prepublish [email protected]
13 verbose addLocalTarball adding from inside cache C:\Users\fire.cnpm\helloworld\1.0.0\package.tgz
14 silly cache afterAdd [email protected]
15 verbose afterAdd C:\Users\fire.cnpm\helloworld\1.0.0\package\package.json not in flight; writing
16 verbose afterAdd C:\Users\fire.cnpm\helloworld\1.0.0\package\package.json written
17 silly publish { name: 'helloworld',
17 silly publish version: '1.0.0',
17 silly publish description: 'the first scoped package',
17 silly publish main: 'index.js',
17 silly publish scripts: { test: 'echo "Error: no test specified" && exit 1' },
17 silly publish keywords: [ 'helloworld', 'demo', 'test' ],
17 silly publish author: { name: 'lfire' },
17 silly publish license: 'ISC',
17 silly publish readme: 'ERROR: No README data found!',
17 silly publish _id: '[email protected]',
17 silly publish _shasum: '6c64b00c4ff36503a080acdae08ec62d6000d593',
17 silly publish _from: '.' }
18 verbose getPublishConfig undefined
19 silly mapToRegistry name helloworld
20 silly mapToRegistry using default registry
21 silly mapToRegistry registry http://miliju.com:7001/
22 silly mapToRegistry uri http://miliju.com:7001/helloworld
23 verbose publish registryBase http://miliju.com:7001/
24 silly publish uploading C:\Users\fire.cnpm\helloworld\1.0.0\package.tgz
25 verbose request uri http://miliju.com:7001/helloworld
26 verbose request sending authorization for write operation
27 info attempt registry request try #1 at 14:00:38
28 verbose request id fac181947d9717d2
29 http request PUT http://miliju.com:7001/helloworld
30 http 403 http://miliju.com:7001/helloworld
31 verbose headers { 'content-type': 'application/json; charset=utf-8',
31 verbose headers 'x-readtime': '18',
31 verbose headers 'content-length': '87',
31 verbose headers date: 'Thu, 17 Sep 2015 06:03:18 GMT',
31 verbose headers connection: 'keep-alive' }
32 verbose request invalidating C:\Users\fire.cnpm\miliju.com_7001\helloworld on PUT
33 error publish Failed PUT 403
34 verbose stack Error: no_perms Private mode enable, only admin can publish this module: helloworld
34 verbose stack at makeError (C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:263:12)
34 verbose stack at CachingRegistryClient. (C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:251:14)
34 verbose stack at Request._callback (C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\node_modules\npm-registry-client\lib\request.js:171:14)
34 verbose stack at Request.self.callback (C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\node_modules\request\request.js:198:22)
34 verbose stack at emitTwo (events.js:87:13)
34 verbose stack at Request.emit (events.js:172:7)
34 verbose stack at Request. (C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\node_modules\request\request.js:1073:14)
34 verbose stack at emitOne (events.js:82:20)
34 verbose stack at Request.emit (events.js:169:7)
34 verbose stack at IncomingMessage. (C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\node_modules\request\request.js:1019:12)
35 verbose statusCode 403
36 verbose pkgid helloworld
37 verbose cwd C:\project\node\helloworld
38 error Windows_NT 10.0.10240
39 error argv "C:\Program Files\nodejs\node.exe" "C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\npm\bin\npm-cli.js" "--userconfig=C:\Users\fire.cnpmrc" "--disturl=https://npm.taobao.org/mirrors/node" "--cache=C:\Users\fire.cnpm" "--registry=http://miliju.com:7001" "--node-gyp=C:\Users\fire\AppData\Roaming\npm\node_modules\cnpm\node_modules\node-gyp\bin\node-gyp.js" "publish" "--registry=http://miliju.com:7001"
40 error node v4.0.0
41 error npm v2.14.3
42 error code E403
43 error no_perms Private mode enable, only admin can publish this module: helloworld
44 error If you need help, you may report this error at:
44 error https://github.com/npm/npm/issues
45 verbose exit [ 1, true ]

@lfire
Copy link
Author

lfire commented Sep 17, 2015

目前已解决,在config/index.js里面配置admin

@lfire lfire closed this as completed Sep 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant