1.0.1 • Published 3 years ago

@bhaskarmantralahub/npm-publish-package v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

npm-publish-package

https://www.youtube.com/watch?v=WRjJW8tseQg

npm whoami

➜  npm-publish-package git:(main) ✗ npm whoami
npm ERR! code ENEEDAUTH
npm ERR! need auth This command requires you to be logged in.
npm ERR! need auth You need to authorize this machine using `npm adduser`

npm ERR! A complete log of this run can be found in:

add npm registry user

https://www.npmjs.com/

npm adduser

after adding user

➜  npm-publish-package git:(main) ✗ npm whoami           
bhaskarmantralahub
//Will open up a browser for npm login
npm login

other npm commands

npm --help

npm publish as public

npm publish --access public

--access public => When publishing for the first time

--access restricted => When publishing as a private package

Scoped packages

https://docs.npmjs.com/cli/v9/using-npm/scope

@somescope/somepackagename

@somescope => npm username or organization name somepackagename => actual package name

Example: @bhaskarmantralahub/test-package

Dependency on package.json as:

    "dependencies": {
    "@bhaskarmantralahub/test-package": "^1.0.0"
    }