2017-09-20 1 views
2

npmjs.com으로 계정을 만들었습니다. 또한 명령 줄 (Linux)에서 how-to-npm 자습서를 따르고 있습니다. 테스트 모듈을 게시해야하는 단계에 있습니다. 때 NPM내 패키지를 npmjs에 게시 할 수없는 이유

npm ERR! publish Failed PUT 402 
npm ERR! Linux 4.10.0-33-generic 
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "publish" 
npm ERR! node v4.7.2 
npm ERR! npm v3.5.2 
npm ERR! code E402 

npm ERR! You must sign up for private packages : @zentech/node 
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!  /home/george/node/npm-debug.log 

내 package.json 파일이

{ 
    "name": "@zentech/node", 
    "version": "1.0.1", 
    "main": "index.js", 
    "preferGlobal": true, 
    "scripts": { 
    "test": "node test.js" 
    }, 
    "author": "", 
    "license": "ISC", 
    "description": "", 
    "repository": "http://github.com/zentech/node" 
} 

사람이 왜 오류를 알고 있지 게시 이러한 모든 오류입니다

You must sign up for private packages : @zentech/node 

:하지만 오류가 계속? 감사

+0

오류에 대해 명확하지 않은 것은 무엇입니까? 비공개 패키지에 가입하지 않은 것 같습니다. 비공개 패키지를 사용하려면 등록해야합니다. –

+0

chech this link https://stackoverflow.com/questions/41981686/getting-error-402-while-publishing-package-using-npm – skr

답변

3

그것은 꽤 분명하다는 :

You must sign up for private packages: @zentech/node

그래서 당신은 가입하거나, 당신은 zentech-node 같은 공공 이름으로 @zentech/node에서 패키지의 이름을 변경합니다.

npm publish --access=public 

을 게시 할 때

@scope/my-package 

즉 범위 패키지를 게시하는 방법으로 위의 의견에 제안한 것처럼

+0

공개 패키지를 게시하려고합니다. (노드가 처음입니다.) 모든 오류는 생소합니다. 내 패키지의 이름을 zentech-node로 바꿔야합니까? – miatech

+0

그것이 작동했습니다. 감사합니다 – miatech

+2

@ miatech 해결책은 무엇입니까? –

1

는 --access 플래그를 사용하는 것입니다 당신 서명 할 필요가 없습니다 패키지를 비공개로 설정하지 않으려면 비공개 패키지를 사용하십시오.

관련 문제