-
Notifications
You must be signed in to change notification settings - Fork 1
NodeJS相关
Kervin edited this page May 14, 2021
·
19 revisions
- https://nodejs.org/dist/v10.15.3/node-v10.15.3-x64.msi
- https://nodejs.org/dist/v11.12.0/node-v11.12.0-x64.msi
- 图形化安装
- 安装目录创建文件夹
- node_global
- node_cache
- NODE_PATH={node_path}
- Path增加%NODE_PATH%\node_global;%NODE_PATH%\node_cache;
node_modules\npm\npmrc
prefix=D:\NodeJS\node_modules\npm
cache=D:\NodeJS\node_cache
tmp=D:\NodeJS\tmp
userconfig=D:\NodeJS\.npmrc
registry=https://registry.npm.taobao.org
- 查询命令
npm config ls -l
- 配置设置命令
npm config set userconfig "D:\NodeJS\.npmrc"
npm config set prefix "D:\NodeJS\node_global"
npm config set cache "D:\NodeJS\node_cache"
npm config set tmp "D:\NodeJS\tmp"
npm config set registry "https://registry.npm.taobao.org"
apt-get autoremove --purge -y nodejs npm
rm -rf /usr/local/lib/node_modules
rm -rf /usr/local/include/node
rm -rf /usr/local/bin/npm
rm -rf /usr/local/bin/npx
rm -rf /usr/local/bin/node
# 查询版本
apt-get install -y apt-show-versions
apt-show-versions -a nodejs
# 安装
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get install nodejs=8.16.1-1nodesource1
# LTS版本
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs
# 最新版本
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt-get install -y nodejs
#查看状态
node -v
npm -v
#设置镜像
npm config set registry https://registry.npm.taobao.org
yum remove -y nodejs npm
yum erase -y nodejs npm
rm -rf /usr/local/lib/node_modules
rm -rf /usr/local/include/node
rm -rf /usr/local/bin/npm
rm -rf /usr/local/bin/npx
rm -rf /usr/local/bin/node
rm -rf /usr/local/n/versions/node
rm -rf /usr/lib/node_modules
rm -rf /usr/local/node*
rm -rf /usr/local/n/versions/node
rm -rf /usr/local/share/doc/node
rm -rf /var/cache/yum/x86_64/7/nodesource/repomd.xml
rm -rf /etc/yum.repos.d/nodesource-el7.repo
# 查询版本
# 安装
curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
sudo yum -y install nodejs
# LTS版14.16.0-1nodesource
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo yum -y install nodejs
# 最新版本
curl -fsSL https://rpm.nodesource.com/setup_15.x | sudo bash -
sudo yum -y install nodejs
#查看状态
node -v
npm -v
#设置镜像
npm config set registry https://registry.npm.taobao.org
npm ERR! code EINTEGRITY
npm ERR! sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y= integrity chexxxxxxxxxxxxxxxxxxxxxxxxxxxxDUqxF47jfwOgvK2UM16SEXk=. (10512 bytes)
解决方法:
rm -rf /tmp/*
npm cache clean --force
rm -rf package-lock.json
rm -rf node_modules/
rm -rf /root/.npm/
npm install
+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/focal/Release'
## Adding the NodeSource signing key to your keyring...
+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null
## Creating apt sources list file for the NodeSource Node.js 14.x repo...
+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x focal main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x focal main' >> /etc/apt/sources.list.d/nodesource.list
## Running `apt-get update` for you...