Node
NodeJS used for Full-Stack Development.
you can use npm (default) or pnpm as Node Package Manager.
Install
brew install nodeUsage
node --version
npm --versionSwitching node version
# To see your current node version
node --version
# To see available node versions
brew search node
# Install any version e.g. 18
brew install node@22
# To unlink from current version
brew unlink node
# To link a different installed version
brew link node@22
brew link --force --overwrite node@22 # some time u have to do this
# To see your current node version (again)
node --version
# to schitch back to latest node version
Publish
Publishing to GitHub Packages
With in your node project:
Use
publishConfigoption in yourpackage.json"publishConfig": { "registry": "https://npm.pkg.github.com/" }Authenticate
npm logout npm login --registry=https://npm.pkg.github.com --scope=@xmlkingPublish
npm publish
You ~/.npmrc might have multiple registries
//registry.npmjs.org/:_authToken=${NPM_TOKEN}FAQ
How to Delete ALL node_modules folders on your machine
cd documents
find . -name "node_modules" -type d -prune -print | xargs du -chsLast updated
Was this helpful?