내가 설치되어 및 라이브러 우분투에서 다음과 같은 코드
sudo apt-get install nodejs
이후 나는 새로운 사용자를 위한 우분투 또한 이것을 실행 코드도
sudo apt-get install npm
지금 할 때 내가 입력
nodejs --version
그것을 보여줍
v0.6.19
제가 확인하고 보는 최신 및 라이브러리 버전은0.10.26
어떻게 업데이트할 수 있습니 내 버 및 라이브러리를0.10.26
?
내가 함께 노력
sudo apt-get install <packagename>
sudo apt-get install --only-upgrade <packagename>
하고 있습니다.
사용n 에서 모듈 고궁하기 위해 업그레이드 노드
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
최신 버전으로 업그레이드하(그리고 현재 안정적인)버전을 사용할 수 있습니다
sudo n latest
sudo apt-get install --reinstall nodejs-legacy # fix /usr/bin/node
sudo n rm 6.0.0 # replace number with version of Node that was installed
sudo npm uninstall -g n
에서 발견된 데이비드 월쉬 블로그 http://davidwalsh.name/upgrade-nodejs
완전한 설치 설명이 있기 때문에 업로드되[여기](https://github.com/nodesource/distributions#installation-instructions 여)Nodesource. 그것은 아래에 복사합니다. 지침은 동일한 업데이트를 위한 최신 버전입니다.
에 대해 걱정하는 경우 컬->sudo,그들이 지침에서 위의 URL 은 수행하는 방법에 대한 설정입니다.
Node.js v13.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=6.x 에 배포판
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_13.x | bash -
apt-get install -y nodejs
Node.js v12.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=6.x 에 배포판
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
Node.js v11.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=6.x 에 배포판
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs
Node.js v10.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=6.x 에 배포판
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get install -y nodejs
Node.js v9.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=6.x 에 배포판
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_9.x | bash -
apt-get install -y nodejs
Node.js v8.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=6.x 에 배포판
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs
Node.js v7.x:
주의:데비안 색색 및 우분투한 정확한 패키지 areNOT할 수 있습니다. 를 참조하시기 바랍실행 Node.js >=4.x 에 배포판
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_7.x | bash -
apt-get install -y nodejs
Node.js v6.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=4.x 에 배포판.
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_6.x | bash -
apt-get install -y nodejs
Node.js v5.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=4.x 에 배포판.
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_5.x | bash -
apt-get install -y nodejs
Node.js v4.x:
참고:사용하는 경우에는 우분투한 정확한 또는 데비안 색색할 수 있습니다 읽기에 대해실행 Node.js >=4.x 에 배포판.
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_4.x | bash -
apt-get install -y nodejs
Node.js v0.12:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_0.12 | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_0.12 | bash -
apt-get install -y nodejs
Node.js v0.10:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_0.10 | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_0.10 | bash -
apt-get install -y nodejs
io.js v3.x:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_iojs_3.x | sudo -E bash -
sudo apt-get install -y iojs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_iojs_3.x | bash -
apt-get install -y iojs
io.js v2.x:
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_iojs_2.x | sudo -E bash -
sudo apt-get install -y iojs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_iojs_2.x | bash -
apt-get install -y iojs
io.js v1.x:
Note:이점 io.js 이지 않는 적극적으로 유지하는 데 사용하지 않는 것이 좋습니다.
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_iojs_1.x | sudo -E bash -
sudo apt-get install -y iojs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_iojs_1.x | bash -
apt-get install -y iojs
이 PPA 가 최신이며 더 이상 유지 되지 않습니다;고려해야 하는 다른 응답 대신 이 하나입니다.
설치할 수 있습니다 최신 버전에서 PPA:
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
내가 사용하는 NVM 하여 노드 버전입니다. 매우 간단한 설치하고 사용하기 쉽습니다.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
를 설치하 NVM 전 세계적으로 대신 사용하여 다음과 같은 컬 명령에 대항(아마도지't 를 사용하여 두 번째 명령만 사용 할 세 번째)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | NVM_DIR=/usr/local/nvm bash
다음 사용하nvm 안정 설치
(또는 삽입하는 버전 번호를 대신안정적인
)을 최/의 특정 버전 노드입니다. 사용nvm 사용하여 안정적인
(또는 특정 버전 번호)를 사용하는 노드 버전입니다. 사용nvm ls
무엇을 보 노드로 버전을 설치하고nvm 안정적인 제거
(또는 특정 버전 번호)제거하의 특정 버전 노드입니다.
또한 사용하는 것이 좋습 nvm 대신하고 또한 제거는 이미 설치된 버전에서 충돌을 피하기 위해 터미널
sudo apt purge nodejs npm
다음 설치 nvm 사용
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
다운로드 및 설치 nvm
nvm install node
다운로드 및 설치 최신 버전의 노드입니다.
를 업데이트 노드를 나중에 그냥
nvm install node
nvm alias default node
나도 동일한 목록에 명령을 내 ubuntu14.04 하지만 그것은 여전히 던지고 오류가 있습니다.
명령을 내가 실행되었다:
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
고 오류를 내가 받:
Invalid version 0.12.2
Line 299: curl not found in /bin/n
내가 무엇을 생각했 컬 유틸리티 설치되지 않았 내 os.
내가 명령 실행:
apt-get install curl
(사 sudo으로 접두사 당신은하지 않
su`)
고 반복되는 단계를 제안에 답하고 그것은 일)
--lts
NVM 에 언급했:https://askubuntu.com/a/441527/52975 하지만 여기가 더 완전한 사용 예는 포함하여 제정신--lts
버전입니다.
NVM 모두 설정 노드 및 npm 을 위해 당신
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh
source ~/.nvm/nvm.sh
nvm install --lts
nvm use --lts
npm --version
지금 그것을 밖으로 테스트로 거짓 패키지:
npm install --global vaca
vaca
이후 소싱 수행되어야에 대한 모든 새로운 shell,설치 스크립트는 해킹을 추가 어떤 자동차 소싱의 끝.barshrc
. 작동하는,그러나 나아보세요를 제거하는 자가 하나 추가하는 내 자신의:
f="$HOME/.nvm/nvm.sh"
if [ -r "$f" ]; then
. "$f" &>'/dev/null'
nvm use --lts &>'/dev/null'
fi
장점:
-를 사용할 수 있습 여러 버전의 노드 및 없이 sudo
-유사 루비 RVM 및 Python 러나 생물 과학과 같은 다른 분야로 널리에 모범 사례 Ruby,Python 커뮤니티
-다운로드를 미리 컴파일된 바이너리가 가능하고,그렇지 않은 경우 그 다운로드 소스를 컴파일 하나를 당신
우리는 쉽게 전환할 수 있습 노드 버전:
nvm install 0.9.0
nvm install 0.9.9
nvm use 0.9.0
node --version
#v0.9.0
nvm use 0.9.9
node --version
#v0.9.9
당신이 사용할 수 있습니다 git 추적.nvmrc
파일을 나타내는 노드로 버전에 대한 자료를 추정하는 데 필요한 프로젝트:https://stackoverflow.com/questions/24869959/how-do-i-specify-a-local-version-of-node-for-a-project/54503474#54503474
테스트 우분투에서 17.10.
이 하나 설치하고 최신 노드 v0.12.* 에서 nodesource.
sudo apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get install -y nodejs
에 대한 노드 v4.x
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
나는 당신이 먼저 제거하는 모든 및 라이브러리를 설치 다음 실행하여 아래 스크립트를 수정한 후 원하는 라이브러리에 해당하는 개발용 버전과 설치 상위 디렉토리
모두 보용 및 라이브러리 버전
아래 스크립트가 설치할 수 있도록 이러 및 라이브러리 버전의 리눅스에서 또는 OSX
#!/bin/bash
# usage :
#
# edit two vars in below : NODE_VER and CODE_PARENT_DIR
#
# ... execute this script as yourself unless you choose a root owned value for var CODE_PARENT_DIR
# whichever id you execute this as determines the id you will issue npm commands as : npm install -g foo-bar
#
# NOTE - nodejs comes bundled with npm ... so no need to do separate npm install
# this scripts runs fine on linux or OSX
# ... copy all the lines starting here .. top of copy .... and ending ... end of copy ...
# and paste into your ~/.bashrc file so proper env vars get set
# ............... top of copy ........................ install_node.sh
# export NODE_VER=v7.2.0 # see available versions at https://nodejs.org/dist/
# export NODE_VER=v8.5.0 # edit this line next time you need to update nodejs
export NODE_VER=v9.3.0 # edit this line next time you need to update nodejs
# ... pick parent dir of nodejs install ... comment out or remove ONE of below
# export CODE_PARENT_DIR=/opt/code # root owned dir ... requires you to sudo prior to npm install going forward
export CODE_PARENT_DIR=${HOME} # RECOMMENDED execute as yourself including npm install
# ......... following env vars are OK no edits needed ... only ever need to edit above vars
curr_OS=$( uname )
echo curr_OS $curr_OS
if [[ "${curr_OS}" == "Darwin" ]]; then
OS_ARCH=darwin-x64
elif [[ "${curr_OS}" == "Linux" ]]; then
OS_ARCH=linux-x64
else
echo "ERROR - failed to recognize OS $curr_OS"
exit 5
fi
if [[ -z ${CODE_PARENT_DIR} ]]; then
echo "ERROR - failed to see env var CODE_PARENT_DIR"
exit 5
fi
export NODE_CODEDIR=${CODE_PARENT_DIR}/nodejs
export COMSUFFIX=tar.gz
export NODE_NAME=node-${NODE_VER}
export NODE_PARENT=${NODE_CODEDIR}/${NODE_NAME}-${OS_ARCH}
export PATH=${NODE_PARENT}/bin:${PATH}
export NODE_PATH=${NODE_PARENT}/lib/node_modules
# ............... end of copy ........................ install_node.sh
# copy and paste above from ... top of copy ... to here into your file ~/.bashrc
echo
echo "NODE_CODEDIR $NODE_CODEDIR<--"
echo
echo "mkdir -p ${NODE_CODEDIR}"
echo
mkdir -p ${NODE_CODEDIR}
echo
echo "cd ${NODE_CODEDIR}"
cd ${NODE_CODEDIR}
echo
# this is compiled code NOT source
[ -f ${NODE_NAME}-${OS_ARCH}.${COMSUFFIX} ] && rm ${NODE_NAME}-${OS_ARCH}.${COMSUFFIX} # if file exists remove
echo "wget -q --show-progress https://nodejs.org/download/release/${NODE_VER}/${NODE_NAME}-${OS_ARCH}.${COMSUFFIX}"
wget -q --show-progress https://nodejs.org/download/release/${NODE_VER}/${NODE_NAME}-${OS_ARCH}.${COMSUFFIX}
echo
echo "tar -C ${NODE_CODEDIR} -xf ${NODE_NAME}-${OS_ARCH}.${COMSUFFIX}"
tar -C ${NODE_CODEDIR} -xf ${NODE_NAME}-${OS_ARCH}.${COMSUFFIX}
echo
[ -f ${NODE_NAME}-${OS_ARCH}.${COMSUFFIX} ] && rm ${NODE_NAME}-${OS_ARCH}.${COMSUFFIX} # if file exists remove
# ........... done ........... #
which node
node --version
# .... bottom of file install_node.sh
내가 노력하고 설치를 통해 nvm 는 대답은 위의 그러나 얼굴에 오류가 우분투 18.04. 그때 나는 과정을 통해 이동
sudo apt purge nodejs npm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
nvm install node
후에 이 명령을 실행하 u 찾을 수 있습하는 오류명령'nvm'을 발견하지 않았다,당신은 mean:
이 경우에는 이 명령을 실행할 수 있습니다
source ~/.nvm/nvm.sh
거나 넣을 수 있습니다 이 파일에 있는/.bashrc 또는~/.프로필에 자동으로드
후할 수 있는 다음 과정을 통해
nvm install node
nvm alias default node