Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

在🚩🇨🇳🏹中科红旗 RedFlag Linux (🍥Debian)安装npmnodejs应用 #12

Closed
englianhu opened this issue Oct 2, 2022 · 0 comments

Comments

@englianhu
Copy link
Contributor

englianhu commented Oct 2, 2022

## https://nodejs.org/en
curl -qL https://nodejs.org/dist/latest/ | sed -n '/linux-x64.tar.gz/p'
wget https://nodejs.org/dist/v18.8.0/node-v18.8.0-linux-x64.tar.xz
which node
# /usr/bin/node
which npm
# /usr/bin/npm

sudo rm -rf -R /usr/bin/node
sudo rm -rf -R /usr/lib/node
sudo rm -rf -R /usr/bin/npm
sudo tar -xf node-v18.8.0-linux-x64.tar.xz -C /usr/lib/
sudo rm -rf node-v18.8.0-linux-x64.tar.xz
sudo mv /usr/lib/node-v18.8.0-linux-x64 /usr/lib/node
sudo chmod 777 -R /usr/lib/node
sudo chmod 777 -R /usr/lib/npm
## /usr/lib/node/


## 方案 01
npm ci
npm config ls
curl -qL https://www.npmjs.com/install.sh | sh

echo "export PATH=/usr/lib/node/bin:${PATH}" | sudo tee /etc/profile.d/node.sh
source /etc/profile.d/node.sh
node -v


## 方案 02
echo "export PATH=/usr/lib/node/bin:${PATH}" | sudo tee -a $HOME/.profile #source
source $HOME/.profile
node -v

参考文献:

@englianhu englianhu changed the title 在🚩🇨🇳🏹红旗中科 RedFlag Linux (🍥Debian 11)安装npmnodejs应用 在🚩🇨🇳🏹中科红旗 RedFlag Linux (🍥Debian)安装npmnodejs应用 Oct 14, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant