gpt4 book ai didi

node.js - 在 Ubuntu Trusty 64 上安装 nodejs 0.10.36

转载 作者:搜寻专家 更新时间:2023-11-01 00:17:59 25 4
gpt4 key购买 nike

具体怎么做?

我通常这样走:

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

但它只给我 0.10.33。使用 apt-get 对我来说是更可取的方式,因为我使用 ansible 设置它并且想要某种程度的可分割性,所以 bash 脚本就像

wget http://nodejs.org/dist/v${NODE_VERSION}/${NODE_DIST}.tar.gz
tar xvzf ${NODE_DIST}.tar.gz
sudo rm -rf /opt/nodejs
sudo mv ${NODE_DIST} /opt/nodejs

sudo ln -sf /opt/nodejs/bin/node /usr/bin/node
sudo ln -sf /opt/nodejs/bin/npm /usr/bin/npm

将是最新的手段。

我使用 Vagrant 镜像 ubuntu/trusty64 在 VirtualBox 上本地运行它。

最佳答案

使用 n 怎么样?

n 是 node.js 的版本管理器,它允许安装多个版本(并为您安装),并使用您想要的版本运行脚本。

你可以这样做:npm install -g n然后,n 0.10.36或者,如果您想要最新版本 n latest或者最后一个稳定版:n stable

关于node.js - 在 Ubuntu Trusty 64 上安装 nodejs 0.10.36,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29181815/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com