Ninawezaje kusasisha nodiJS yangu kwa toleo jipya zaidi?


Nenda kwa jibu lililokubaliwa


Nimeweka nodeJS kwenye Ubuntu na nambari ifuatayo

 sudo apt-get install nodejs
 

Kwa kuwa mimi ni mtumiaji mpya wa ubuntu pia niliendesha nambari hii pia

 sudo apt-get install npm
 

Sasa wakati mimi huandika

  nodejs --version
 

Inaonyesha

 v0.6.19
 

Niliangalia na kuona toleo la hivi karibuni la nodeJS ni 0.10.26

Ninawezaje kusasisha toleo langu la nodeJS kwa 0.10.26 ?

Nilijaribu na

  sudo apt-get install <packagename>
 sudo apt-get install --only-upgrade <packagename>
 

lakini hakuna bahati.


654





2014-02-26




Idadi ya majibu: 13


Tumia n moduli kutoka npm ili kuboresha nodi

 sudo npm cache clean -f
sudo npm install -g n
sudo n stable
 

Ili kuboresha toleo la hivi karibuni (na sio la sasa), unaweza kutumia

 sudo n latest
 
  • Kurekebisha PATH:

     sudo apt-get install --reinstall nodejs-legacy     # fix /usr/bin/node
     
  • Kutendua:

     sudo n rm 6.0.0     # replace number with version of Node that was installed
    sudo npm uninstall -g n
     

Kupatikana katika David Walsh blog http://davidwalsh.name/upgrade-nodejs


1163


2014-06-08

Maagizo kamili ya ufungaji tangu kupakiwa hapa na Nodesource. Imenakiliwa hapa chini kwa kumbukumbu yako. Maagizo ni sawa kwa kusasisha kwa toleo la hivi karibuni.

Ikiwa una wasiwasi kuhusu curl -> sudo, zina maagizo kwenye URL hapo juu juu ya jinsi ya kufanya usanidi kwa mkono.

Node.js v13.x :

KUMBUKA: Ikiwa unatumia Utu wa Ubuntu au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 6.x kwenye diski za wakubwa.

 # 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 :

KUMBUKA: Ikiwa unatumia Utu wa Ubuntu au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 6.x kwenye diski za wakubwa.

 # 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 :

KUMBUKA: Ikiwa unatumia Utu wa Ubuntu au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 6.x kwenye diski za wakubwa.

 # 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 :

KUMBUKA: Ikiwa unatumia Utu wa Ubuntu au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 6.x kwenye diski za wakubwa.

 # 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 :

KUMBUKA: Ikiwa unatumia Utu wa Ubuntu au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 6.x kwenye diski za wakubwa.

 # 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 :

KUMBUKA: Ikiwa unatumia Utu wa Ubuntu au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 6.x kwenye diski za wakubwa.

 # 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 :

NOTE: Debian Wheezy na paket Ubuntu sahihi ni NOT inapatikana kwa kutolewa hii. Tafadhali rejista inayoendesha Node.js> = 4.x kwenye safu ya wazee

 # 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 :

KUMBUKA: Ikiwa unatumia Ubuntu Precise au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 4.x kwenye distros ya zamani .

 # 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 :

KUMBUKA: Ikiwa unatumia Ubuntu Precise au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 4.x kwenye distros ya zamani .

 # 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 :

KUMBUKA: Ikiwa unatumia Ubuntu Precise au Debian Wheezy, unaweza kutaka kusoma kuhusu kukimbia Node.js> = 4.x kwenye distros ya zamani .

 # 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 :

Kumbuka: tawi hili la io.js halihifadhiwa kikamilifu na haifai matumizi ya uzalishaji.

 # 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
 

382


2014-11-12

PPA hii ni ya zamani na haijatunzwa tena; unapaswa kuzingatia majibu mengine badala ya hii.

Unaweza kusasisha toleo la hivi karibuni kutoka PPA:

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

27


2014-02-26

Ninatumia NVM kushughulikia matoleo yangu ya Node. Rahisi sana kuanzisha na rahisi kutumia.

 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
 

Kufunga NVM kimataifa badala yake, tumia amri ifuatayo ya curl badala ya ile iliyo hapo juu (na labda usitumie amri ya pili lakini utumie ya tatu)

 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | NVM_DIR=/usr/local/nvm bash
 

Kisha utumie nvm install stable (au ingiza nambari ya toleo badala ya stable ) kupata toleo la hivi karibuni la / Node. Tumia nvm use stable (au nambari fulani ya toleo) kutumia toleo la Node. Tumia nvm ls kuona ni aina gani za Node ambazo umesanikisha na nvm uninstall stable (au nambari maalum ya toleo) kuondoa toleo fulani la Node.

Vyanzo: Sasisha , tumia


20


2014-03-31

Ninapendekeza pia kutumia nvm badala yake, na pia kuondoa toleo lililowekwa tayari ili kuzuia migogoro kwenye terminal

 sudo apt purge nodejs npm
 

kisha usakinishe nvm na utumie

Maelezo ya Video

 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
 

kupakua na kusanikisha nvm

 nvm install node
 

inapaswa kupakua na kusanikisha toleo la hivi karibuni la nodi.

Ili kusasisha node baadaye fanya tu

 nvm install node
nvm alias default node
 

18


2018-02-25

Nilijaribu amri sawa za orodha kwenye ubuntu wangu 14.04 lakini ilikuwa bado ikitupa kosa.

Amri nilizozifanya zilikuwa:

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

na kosa nilikuwa nikipata:

 Invalid version 0.12.2
Line 299: curl not found in /bin/n
 

Kile nilifikiria ni matumizi ya curl hayakuwekwa kwenye os yangu.

Niliamuru amri:

 apt-get install curl
 

(tumia sudo kiambishi awali ikiwa hauko su )

na kisha kurudia hatua zinaonyesha kwa kujibu na inafanya kazi;)


4


2015-04-12

NVM (Meneja wa Toleo la Node) na --lts

NVM ilitajwa kwa: https://askubuntu.com/a/441527/52975 lakini hapa kuna mfano kamili wa utumiaji, pamoja na --lts toleo la ujanja .

NVM inasanikisha nodi mbili za kisasa na npm kwako

 curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | sh
source ~/.nvm/nvm.sh
nvm install --lts
nvm use --lts
npm --version
 

Sasa jaribu na kifurushi cha dummy:

 npm install --global vaca
vaca
 

Kwa kuwa urekebishaji huo lazima ufanyike kwa kila ganda jipya, hacks za hati ya kusanikishia huongeza uchunguliaji wa auto hadi mwisho wako .barshrc . Hiyo inafanya kazi, lakini napendelea kuondoa iliyoongeza otomatiki na kuongeza yangu:

 f="$HOME/.nvm/nvm.sh"
if [ -r "$f" ]; then
  . "$f" &>'/dev/null'
  nvm use --lts &>'/dev/null'
fi
 

Manufaa:

  • hukuruhusu kutumia toleo nyingi za Node na bila sudo

  • ni ya kufurahisha kwa Ruby RVM na Python Virtualenv, inayozingatiwa sana mazoea bora katika jamii za Ruby na Python

  • kupakua binary iliyoundwa mapema ikiwa inawezekana, na ikiwa sio kupakua chanzo na kukutengenezea moja

Tunaweza kubadilisha kwa urahisi matoleo ya node na:

 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
 

Kisha unaweza kutumia .nvmrc faili iliyofuatiliwa ya git kuashiria toleo la nodi inayohitajika kwa mradi fulani: https://stackoverflow.com/questions/24869959/how-do-i-specify-a-local-version-of-node-for -a-mradi / 54503474 # 54503474

Kujaribiwa kwa Ubuntu 17.10.


4



Hii inasanikisha node ya hivi karibuni v0.12. * Kutoka nodeource.

 sudo apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -
sudo apt-get install -y nodejs
 

Kwa node v4.x

 curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
 

2


2015-05-13

Kutumia nvm ni njia inayopendelewa. Kwanza sasisha nvm:

 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
 

Kisha usanikishe nodejs:

 nvm install node
 

Sasa, unaweza kubadilisha mabadiliko ya nodi.


2


2018-07-18

Ninakupendekeza kwanza uondoe usanidi wote wa nodejs kisha utekeleze chini ya hati mara moja unabadilisha na toleo la nodejs linalotaka na saraka yake ya kusanidi mzazi

tazama matoleo yote yanayopatikana ya nodejs

https://nodejs.org/dist/

Nakala ya chini itakuruhusu kusanikisha yoyote ya toleo hizo za nodejs kwenye linux au 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
 

1


2017-09-25

Ikiwa utumiaji n haufanyi kazi, unaweza kusanikisha toleo la hivi karibuni la nodejs (ie toleo la 8) liko na amri zifuatazo.

 curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

sudo apt-get install -y nodejs
 

Maelekezo zaidi ni hapa .


1


2018-05-04

Ikiwa uko nyuma ya proksi, labda unaweza kupata hitilafu hii wakati unaendesha 'sudo n solid':

 Error: invalid version
 

Lazima uweke viini vya env kama hii:

 export HTTP_PROXY=http://your-proxy-url:port
export HTTPS_PROXY=http://your-proxy-url:port
 

Na kisha endesha agizo la kupitisha violezo hivi kwa mtumiaji wa mizizi:

 sudo -E n stable
 

0


2018-06-08

Ninajaribu kusanikisha kupitia nvm ambayo imejibiwa hapo juu lakini tunakabiliwa na makosa katika ubuntu 18.04. basi mimi kupitia mchakato huu

 sudo apt purge nodejs npm

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

nvm install node
 

baada ya kukimbia amri hii unaweza kupata kosa hilo Command 'nvm' not found, did you mean:

kwa hivyo unaweza kuendesha amri hii

 source ~/.nvm/nvm.sh
 

AU AU unaweza kuiweka katika faili /.bashrc au ~ / .profile ili kuipakia kiotomatiki

baada ya hapo unaweza kupitia mchakato unaofuata

 nvm install node
nvm alias default node
 

0


2019-09-04