brew install npm "npm: command not found" - Stack Overflow

文章推薦指數: 80 %
投票人數:10人

I've tried to run brew install npm , however I just got following response node-5.0.0 already installed . It happened with node also returning command not found ... Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam Collectives™onStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. LearnmoreaboutCollectives Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. LearnmoreaboutTeams brewinstallnpm"npm:commandnotfound" AskQuestion Asked 6years,10monthsago Modified 1monthago Viewed 52ktimes 61 16 I'veinstallednodeusingbrewinstallnodeandwhenIusethenode-vIgetfollowingv5.0.0.HoweverwhenItrytorunthenpmcommandIgetnpm:commandnotfound. I'vetriedtorunbrewinstallnpm,howeverIjustgotfollowingresponsenode-5.0.0alreadyinstalled. Ithappenedwithnodealsoreturningcommandnotfound,butthatIfixedbyrunningbrewlinknode,howevernpmstilldoesnotseemtowork. HowcanIresolvethisproblem? node.jsbashnpmosx-elcapitan Share Follow editedNov6,2015at20:42 AlexdaSilva 4,49222goldbadges1515silverbadges2323bronzebadges askedNov6,2015at20:19 PeterPikPeterPik 10.9k1818goldbadges8383silverbadges135135bronzebadges 1 doyoutrytorunbrewdoctor?Removecompletelynodejsfromyoursystemandtrytoreinstallagain – vmkcom Nov6,2015at20:56 Addacomment  |  6Answers 6 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) 77 Iencounteredthesameissue.Aftersearchingandreadingdifferentthingsonline,whatworkedformewas: $brewpostinstallnode However,firstpleasedoexecute: $brewdoctor andfollowtheinstructionstherefirst,likethecommentinyourquestionmentions. Share Follow answeredApr14,2016at18:42 mpavelmpavel 95111goldbadge66silverbadges77bronzebadges 5 11 Formethiswasduetoalinkingissuewhenrunningbrewinstallnode.AfterhavingsuccessfullyrunningbrewlinknodeIalsoneededtorunbrewpostinstallnodeforittoaddnpmtoo. – RichieAHB Nov25,2016at11:12 THANKYOU!youmademydaysir! – rvandoni Jan12,2018at15:41 Afterfindingdozensofhow-toswithhundredsoflinesofinstructionsthatgodeepintothegutsofHomebrew,thisworkedandshouldbethecorrectanswer. – ZackMorris Mar15,2018at21:46 2 UPDATE:Althoughthisdoeswork,runningbrewremove--forceyarn&&brewremove--forcenodethenrunningbrewinstallnodefixednpmsothatIdidn'tneedtocallbrewpostinstallnodeanymore.ThenIcalledbrewinstallyarn.SoIthinkpartoftheproblemwashavingmultipleversionsofyarnand/ornodeinstalled. – ZackMorris Mar16,2018at19:51 brewdoctorhelpedmerememberIhadcontributedsomycorerepowasnotinmaster,thenIcouldreinstallnodeanditfixedit – Efren Jan16,2020at22:25 Addacomment  |  49 Tryrunning $brewpostinstallnode Ifyoueverransudonpm/sudoyarn,thenyoumightneedtochangetheownerofyourglobalnode_modulesfolder: $sudochown-R"$(id-un)""${NODE_PATH:-/usr/local/lib/node_modules}" Share Follow editedAug22at6:19 answeredNov6,2015at21:40 AndreasLouvAndreasLouv 44.9k1313goldbadges9696silverbadges118118bronzebadges 1 6 The--without-npmoptionisnolongervalid – Staghouse Mar10,2019at8:09 Addacomment  |  44 Trythefollowing: $brewupdate $brewuninstallnode $brewinstallnode $sudochown-RYourLocalUserName/usr/local/lib/node_modules/ $brewpostinstallnode Share Follow editedJul26at15:42 Sun 2,00222goldbadges2121silverbadges2727bronzebadges answeredJun4,2017at16:46 dian.indian.in 44144silverbadges22bronzebadges 3 8 thisisaproperworkinganswerformacusers.step4isthesolutiontotheissue – Dipesh Jun10,2020at10:46 Thanks,itworksforme.Theonlythingis-Rusername.Actually,Ithinksudobrewposinstallnodemightworktooifit'saprivilegeproblem. – RogerGuo May26,2021at2:40 Workedforme(andstep4wasmymissinglink) – jack Jun7at16:54 Addacomment  |  1 thesameproblemwithyou,Ifixedby: /usr/local/lib/node_modules/npm/bin/npm-cli.jsi-gnpm Share Follow answeredDec27,2017at7:56 zhulinpinyuzhulinpinyu 53966silverbadges1212bronzebadges Addacomment  |  0 Iusedcyrillic(non-latin)charactersinmyhostname/computernameonmac.Andthatwastheproblem.Afterichangedthisandreinstallednode/npmwithHomebreweverythingworkedlikenormal.Noutf8in2017?:/ Share Follow answeredSep24,2017at18:07 TadejTadej 6,04455goldbadges4949silverbadges6666bronzebadges Addacomment  |  0 running:echo'exportPATH="/opt/homebrew/opt/node@16/bin:$PATH"'>>~/.zshrcshouldwork,changenode@16tojustnodeorwhicheverversionyoujustinstalled. Share Follow answeredNov7,2021at13:05 PianisimoPianisimo 7966bronzebadges 1 Mightbeobvious,butthisworksonlyifyou'reusingZSH – dgebert Aug9at15:01 Addacomment  |  YourAnswer ThanksforcontributingananswertoStackOverflow!Pleasebesuretoanswerthequestion.Providedetailsandshareyourresearch!Butavoid…Askingforhelp,clarification,orrespondingtootheranswers.Makingstatementsbasedonopinion;backthemupwithreferencesorpersonalexperience.Tolearnmore,seeourtipsonwritinggreatanswers. Draftsaved Draftdiscarded Signuporlogin SignupusingGoogle SignupusingFacebook SignupusingEmailandPassword Submit Postasaguest Name Email Required,butnevershown PostYourAnswer Discard Byclicking“PostYourAnswer”,youagreetoourtermsofservice,privacypolicyandcookiepolicy Nottheansweryou'relookingfor?Browseotherquestionstaggednode.jsbashnpmosx-elcapitanoraskyourownquestion. TheOverflowBlog StackOverflowtrends:Weekdayvsweekendsiteactivity Don’tletsoftwarestealyourtime(Ep.491) FeaturedonMeta RecentColorContrastChangesandAccessibilityUpdates Revieweroverboard!Orarequesttoimprovetheonboardingguidancefornew... CollectivesUpdate:RecognizedMembers,Articles,andGitLab ShouldIexplainotherpeople'scode-onlyanswers? Linked 97 howtoupdatenpmonmacOS 4 HomebrewinstallNode.js:CommandNotFound Related 2228 HowdoIsetavariabletotheoutputofacommandinBash? 1361 Wheredoesnpminstallpackages? 2792 Findtheversionofaninstallednpmpackage 1640 HowdoIcompletelyuninstallNode.js,andreinstallfrombeginning(MacOSX) 1442 Howtofixnpmthrowingerrorwithoutsudo 568 NodeVersionManagerinstall-nvmcommandnotfound 2668 What'sthedifferencebetweendependencies,devDependenciesandpeerDependenciesinnpmpackage.jsonfile? 2836 Whatisthe--saveoptionfornpminstall? 695 NodeSasscouldn'tfindabindingforyourcurrentenvironment 2214 DoIcommitthepackage-lock.jsonfilecreatedbynpm5? HotNetworkQuestions Whycan'tyousay"Adollwasmademebymysister"? Isthereawaytocomputethespectrumeffectofanon-linearfunction? IstherearoutinelikeFETCH,STASHandSWAPfortransferingdatabetweenmemorybank0and1ontheC128? InEarlyModernEnglish,arethereexamplesofthe"a-+gerund"progressiveconstructionwherethegerundbeginswithavowel? IsWheelock'sLatincomprehensive? Howdoesthekrakengetitsbait? TutorialrequestonimplementingHiGHSsolver Howdocustomindexesimpactperformancenegatively? WhenArtemisrunsoutofrollbacks FoundamistakeinapublishedpaperatIEEETransactionsonIndustrialInformatics Whydoes"graphic"meanviolentorgory? ReasonstodistrustLet'sEncryptcertificates Alchemist'sFireandBurnit!Criticaldamage CopiedtheredbandoftheRGBTIFFfilewithGDALinC++ OntheLM,whatisthedifferencebetweenABORTandABORTSTAGE? DoestheWizard'sSpellMasteryspellsneedtobepreparedasaWizardorcantheybe"known"? HowdoIsolvethissudokuwithoutguessing Howtogetthephysical(absolut)pagenumber CanIshareacopyofAdobeStandaloneFlashPlayer? Areacademicgroupsallowedtousegrantfundstohedgeagainstforexchanges? Howtorenameafilethatcontainsspacesinterminal? var()isnotequaltosd()^2inR Whydocarblinkersflashattwicethespeedwhenablinkerlighthasburnedout Arobotthatdoesn'trepeatmovetriplets morehotquestions Questionfeed SubscribetoRSS Questionfeed TosubscribetothisRSSfeed,copyandpastethisURLintoyourRSSreader. default Yourprivacy Byclicking“Acceptallcookies”,youagreeStackExchangecanstorecookiesonyourdeviceanddiscloseinformationinaccordancewithourCookiePolicy. Acceptallcookies Customizesettings  



請為這篇文章評分?