nodejs16.17.0

DevOps nodejs评论9,147字数 862阅读2分52秒阅读模式

Latest LTS Version: 16.17.0 (includes npm 8.15.0)

Download the Node.js source code or a pre-built installer for your platform, and start developing today.

nodejs16.17.0

创建安装目录

[root@us-common-sre-jenkins-1 bin]# mkdir -p /usr/local/node
[root@us-common-sre-jenkins-1 bin]# chmod 777 /usr/local/node

下载node

[root@us-common-sre-jenkins-1 ~]# wget https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz
[root@us-common-sre-jenkins-1 ~]#  tar -xvf node-v16.17.0-linux-x64.tar.xz -C /usr/local/node/

配置环境变量

[root@us-common-sre-jenkins-1 ~]# vim ~/.bashrc
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
export NODE=/usr/local/node/node-v16.17.0-linux-x64
export PATH=${NODE}/bin:$PATH
[root@us-common-sre-jenkins-1 ~]#  source ~/.bashrc

验证

[root@us-common-sre-jenkins-1 ~]#  node -v
v16.17.0
[root@us-common-sre-jenkins-1 ~]# npm -v
8.15.0

继续阅读
DevOps
  • 本文由 发表于 2022年9月19日 10:34:17
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
npm: command not found nodejs

npm: command not found

运行:which npm 找到npm安装路径 [xiaoxin@iZ2zed99h19kmb7fgbjcghZ ~]$ which npm /usr/local/node/node-v10.14....
yarn安装 nodejs

yarn安装

Install via npm It is recommended to install Yarn through the npm package manager, which comes bund...
评论  0  访客  0

发表评论