NodeJS - zacisco/notes GitHub Wiki
NVM (prefered method)
go to NVM Repo
N (2nd prefered method)
go to N Repo
NodeJS itself
Download
https://nodejs.org/en/download/ - LTS
https://nodejs.org/en/download/current/ - Current
Unpack and install
unpack to bin,include,man,share to /usr/local
or
unpack all to /opt
chown -R root:root _path_to_nodejs_
chmod -R +w _path_to_nodejs_
in /etc/profiles.d
echo export PATH=$PATH:_path_to_nodejs_/bin > nodejs.sh
for apply now:
. /etc/profiles.d/./nodejs.sh
Enable Corepack
Node.js >= 16.10:
corepack enable
Node.js < 16.10:
npm i -g corepack
Yarn
yarn init -2
- By default, yarn init -2 will setup your project to be compatible with Zero-Installs, which requires checking-in your cache in your repository; check your .gitignore if you wish to disable this.
Yarn update
yarn set version stable
Webpack Dev Server
Migrate from v3 to v4 and Migrate from v3 to v4 issues
"start": "webpack serve --mode development --hot"
- run dev-server through @webpack-cli/serve