Canza sigar npm ษinku wani muhimmin sashi ne na kiyaye yanayin ci gaba mai santsi, mara bug. Npm, ko Node Package Manager, shine mai sarrafa fakitin buษe ido don JavaScript. Kayan aiki ne da masu haษakawa a duk duniya ke amfani da shi don rabawa da aro fakitin lamba. Ko kuna buฦatar haษaka zuwa sabon sigar ko rage darajar zuwa tsohon, sanin yadda ake sarrafa sigar npm shine maษalli. Wannan gaskiya ne musamman idan kuna aiki akan ayyuka da yawa tare da nau'ikan kumburi daban-daban.
Yanzu, bari mu shiga cikin tsarin da ya kamata a bi don cimma wannan.
Sanya Manajan Sigar Node (NVM)
A kan hanyar canza sigar npm, da farko muna buฦatar shigar da NVM. NVM yana ba ku damar shigarwa da sarrafa nau'ikan Node.js da npm da yawa.
//You can install NVM by using the install script using cURL: curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash // Or using Wget if you prefer: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Shigar da takamaiman Sigar Node.js da npm
Bayan shigar da NVM cikin nasara, zaku iya shigar da takamaiman sigar Node.js da npm.
//To install a version use the nvm install command followed by the version number: nvm install 10.16.0
- Don amfani da sigar da aka shigar, gudanar da umarnin amfani da nvm sannan lambar sigar ta biyo baya.
- Da zarar an gama, zaku iya duba sigar node da npm da aka shigar ta amfani da node -v da npm -v umarni.
Ana ษaukaka npm
Don sabunta npm, kuna iya amfani da npm shigar npm@last -g don tabbatar da cewa an tsara dukkan nodes zuwa juna ba tare da matsala ba. Aiwatar da wannan zai tabbatar da sadarwa tsakanin juzu'i daban-daban, rike da m kwarara.
npm install npm@latest -g
Bayan bin waษannan matakan, yakamata a sabunta npm ษinku zuwa sigar da ake buฦata. Yi Magana ta juyawa tsakanin sigogin, kamar yadda yake a sau da yawa bukata a cikin ayyukanmu da yawa, duniyar da ta gabata.
Ka tuna don ci gaba da sabuntawa, yayin da ake fitar da sabbin sigogi akai-akai, suna alfahari da ingantattun fasaloli, haษaka aiki da ฦananan kwari. Fahimtar waษannan ฦananan abubuwan fasaha yana da mahimmanci don zama ฦwararren mai haษakawa.