The environment

  • Ubantu (alternative server of your choice, preferably Unix)
  • docker

Download the Nexus

  • downloaddocker pull sonatype/nexus3
  • rundocker run -d -p 8081:8081 sonatype/nexus3
  • Open http://localhost:8081/

The login

  • User name admin

  • How do I find the password?

find / -name 'admin.password'

The file on the catYou can see the password

configuration

Refer to www.eryajf.net/1956.html

release

npm config set registry http://localhost:8081/repository/group-npm/

npm login

npm publish
Copy the code

If publish 401 check the following

  • configurationpackage.json
"publishConfig": {
    "registry": "http://192.168.153.128:8081/repository/local-npm/"
}
Copy the code
  • Need to configure the.npmrcfilereference
  • Configure NPM Bearer Token realms

I also experienced a lot of trample pits to build out hope we learn together

Reference stackoverflow.com/questions/5…