Nexus - npm repository publish

킹콩(King Kong)·2025년 2월 11일

npm repository publish

* nexus에 npm repoisotry를 생성한다.
	* nexus.test.com > (Admin Login) -> Reposiroty 이동
	* Create reposotory > npm(hosted) > Name 입력 후 > Create repository 눌러 생성
    
  • 권한 부여
    * Security > Realms > Active Realms 에서 'npm Bearer Token Realm' 활성화 시킴

  • NPM Repository 접속

    • repository에 로그인 하면 ~/.npmrc파일에 로그인 정보가 기록 됨
$> npm login --registry=http://nexus.test.com/repository/npm/
Username:
Password:
  • 로그인 시 아래 오류 발생하면 위에 'Security > Realms > Active Realms 에서 'npm Bearer Token Realm' 활성화 시킴
$> npm publish
...
npm ERR! code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
  • PRIVATE Error : 아래와 같이 EPRIVATE 오류 발생하면
    • package.json 파일에서 private: true를 삭제한다.
$> npmpublish
...
npm ERR! This package has been marked as private
npm ERR! Remove the 'private' field from the package.json to publish it.
profile
IT를 쉽게 이해해 보아요~😄

0개의 댓글