[Exchange and share] 求助 如何安装 Nodejs
Tofloor
poster avatar
飞鱼
deepin
2022-08-21 05:19
Author

提示依赖错误,不可修复. 试用aptitude命令依然未能解决

Reply Favorite View the author
All Replies
神末shenmo
deepin
Spark-App
Q&A Team
2022-08-21 05:43
#1

用nvm

Reply View the author
tang20201209
deepin
2022-08-21 07:01
#2

安装一个docker什么都可以搞

Reply View the author
butu
deepin
2022-08-21 07:31
#3

可以用nvm来装,或者指定node版本进行安装

Reply View the author
butu
deepin
2022-08-21 07:31
#4

记得换源

Reply View the author
MarioAi
deepin
2022-08-21 08:07
#5

下载编译后的二进制免安装

,添加 ~/.bashrc

# Node/NPM 环境变量添加
# Node版本: node-v15.5.1-linux-x64
# 绝对地址: /home/mario/Dev/Pro/node-v15.5.1-linux-x64
# 相对地址: ~/Dev/Pro/node-v15.5.1-linux-x64
# 本变量仅适用于mario账户之下,作为前端开发调试环境,下面脚本开始
NODE_HOME=$DEV_HOME/Dev/Pro/node-linux-x64
if [ -d "$NODE_HOME" ]
then
    # Node目录验证正常,添加目录
    export PATH=$PATH:$NODE_HOME/bin
else
    # Node目录查找失败,报错
    echo 'There has no NODE_HOME path , can not add for PATH ' 
fi

Reply View the author
lflflf
deepin
2022-08-21 08:23
#6

root权限运行

#!/bin/bash
nodejsfile=node-v16.15.1-linux-x64.tar.xz
if [ ! -f "$nodejsfile" ]; then
    wget https://nodejs.org/dist/v16.15.1/$nodejsfile -O $nodejsfile
fi
if [ ! -d "node-v16.13.0-linux-x64" ]; then
    tar -xvf $nodejsfile
fi
#安装
cp -a node-v16.15.1-linux-x64/bin/{corepack,node,npm,npx} /bin
cp -a node-v16.15.1-linux-x64/lib/node_modules /lib
node -v
npm -v

# #删除
# ls /bin/* -l |grep /lib/node_modules/|awk '{print $9}'|xargs -I {} rm -f {}
# rm -f /bin/node
# rm -vfr /lib/node_modules

Reply View the author
uos008
deepin
2022-08-21 09:09
#7

当前由于源不可用,如果有依赖问题,只能自己上网上找包,或者临时添加debian bullseye sid的源,安装完再停用。

Reply View the author
SamLukeYes
deepin
2022-08-21 17:01
#8

https://nixos.org/#asciinema-demo-cover

NixOS 官网的例子,拿走不谢joy

Reply View the author
ljq790615
deepin
2022-08-22 00:28
#9

root权限运行

wget -q -c https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz
tar -xJf node-v16.17.0-linux-x64.tar.xz
cd node-v16.17.0-linux-x64
sudo cp -rf ./bin/* /usr/local/bin/
sudo cp -rf ./include/* /usr/local/include/
sudo cp -rf ./lib/* /usr/local/lib/
sudo cp -rf ./share/* /usr/local/share/
# 为 npm 添加国内淘宝镜像源
npm config set registry https://registry.npm.taobao.org
cd ../
rm node-v16.17.0-linux-x64*
Reply View the author
飞鱼
deepin
2022-08-25 16:37
#10

非常感谢各位,已经解决啦。

Reply View the author
ThinKinG
deepin testing team
2022-09-01 18:03
#11

like

Reply View the author