[Solved] can't brew install node | 9to5Answer
文章推薦指數: 80 %
I ran into this problem on a new MacBook Pro on Mac OS High Sierra. I gleaned brew was trying to use directories named include and lib under /usr/local that ... can'tbrewinstallnode can'tbrewinstallnode node.js terminal installation homebrew 77,267 Solution1 Therearetwostepsinvolved. Simplyrunthesefourcommands: sudochown-R`whoami`:admin/usr/local/include/node sudochown-R`whoami`:admin/usr/local/bin sudochown-R`whoami`:admin/usr/local/share sudochown-R`whoami`:admin/usr/local/lib/dtrace Finally,runtheoverwritecommand: brewlink--overwritenode Solution2 Iranintothissameissueunderthesamecircumstances.Iwasabletogetthebrewversiontoinstallsuccessfullyby: Runbrewinstallnode Makenoteofthemodulethatiscausingtheissueanddeleteit.Inyourcase,thiswouldbe/usr/local/include/node Uninstall-brewuninstallnode Re-install-brewinstallnode Ihadtorepeatthisprocessafewtimesforeachremainingproblematicdirectory(about3differentonesinactuality),andtheinstalleventuallysucceededwithoutanyissues. Solution3 IranintothisproblemonanewMacBookProonMacOSHighSierra.Igleanedbrewwastryingtousedirectoriesnamedincludeandlibunder/usr/localthatwasnotthere.Sincerootowns/usrIhadtodoitmanually-makingsurethatwhoamiownermatchespeerdirectoriesin/usr/local: sudomkdir/usr/local/include chown`whoami`:admin/usr/local/include sudomkdir/usr/local/lib chown`whoami`:admin/usr/local/lib Andthentomatchtheotherdirectoriesin/usr/localIdid: chmod775/usr/local/include chmod775/usr/local/lib thenthefollowingworked: brewuninstallnode brewinstallnode Solution4 Youneedtomake/usr/local/binand/usr/local/sharewritable.Iusedthisanswertoachievethis.Belowisthekeyadviceintheanswerreplicatedincasethelinkbreaks: sudochown-R`whoami`:admin/usr/local/bin sudochown-R`whoami`:admin/usr/local/share Solution5 Ihadthesameerror: Linking/usr/local/Cellar/node/11.10.0... Error:Couldnotsymlinkinclude/node/usr/local/includeisnotwritable. Solution: $sudomkdir/usr/local/include $sudochown-R$(whoami)$(brew--prefix)/* $brewlinknode Linking/usr/local/Cellar/node/11.10.0...7symlinkscreated $node-v=>v11.10.0 $npm-v=>6.7.0 Viewmoresolutions Share: 77,267 RelatedvideosonYoutube 03:59 HowtoinstallNode.jsonMac/MacTerminal-commandnotfound:node TechDivisions 887 01:11:25 CNFTBrew:ExcitingDrops&CNFTNewswithBlakeCNFT(SpecialGuestEdition!) CardanoThor 551 04:52 InstallNodejstherightwayinM1Mac TechFewSteps 421 05:17 HowtoInstallNode.jsonMacOS ProgrammingKnowledge 100 10:00 HowtoinstallanduseNodeVersionManager(NVM) DevCafé 35 04:02 HowtodownloadNodeJSandinstallNPMonMacOSBigSurAppleMacbookM1 TechDecodeTutorials 34 10:49 Howtosolvethehomebrewinstallationproblem"Zsh:commandnotfound-brew" iTECH 33 04:54 InstallNodeandNVMonM1,M1Pro,M1MaxMacs AlexZiskind 29 02:39 InstallNodeJSandNPMusingHomebrewandNVM-SimplifiedSunday MindzGroupTech 5 02:34 HowtoinstallNodejsonMac[Anyversion&Easymethod]|2022 TechTime 1 Authorby Francis UpdatedonFebruary14,2020 Comments Francis over2years IamtryingtoupgrademynodeviahomebrewbutranintoaproblembecauseIthinkItriedtodownloadthroughthewebsite.Iamverynewtoterminal.I'vetriedtosearchforanswersbutmanypeoplesayyoucanjustdeletetheunbrewedheaderfiles.Iamnotsurehowtodothat.butforsomereasonwhenItrytobrewinstallnode,itsaysthebrewlinkstepdidnotcompletesuccessfully. Ialsotriedtobrewlinknodebutthatdoesn'tworkeither.IranoutofoptionssoIcamehere. [[email protected]~]$brewinstallnode ==>Downloadinghttps://homebrew.bintray.com/bottles/node-0.12.7.yosemite.bottle.tar.gz Alreadydownloaded:/Library/Caches/Homebrew/node-0.12.7.yosemite.bottle.tar.gz ==>Pouringnode-0.12.7.yosemite.bottle.tar.gz ==>Caveats Bashcompletionhasbeeninstalledto: /usr/local/etc/bash_completion.d Error:The`brewlink`stepdidnotcompletesuccessfully Theformulabuilt,butisnotsymlinkedinto/usr/local Couldnotsymlinkinclude/node/android-ifaddrs.h /usr/local/include/nodeisnotwritable. Youcantryagainusing: brewlinknode Warning:Thepost-installstepdidnotcompletesuccessfully Youcantryagainusing`brewpostinstallnode` ==>Summary 🍺/usr/local/Cellar/node/0.12.7:2726files,31M thisiswhathappenswhenibrewdoctor [[email protected]~]$brewdoctor PleasenotethatthesewarningsarejustusedtohelptheHomebrewmaintainers withdebuggingifyoufileanissue.IfeverythingyouuseHomebrewforis workingfine:pleasedon'tworryandjustignorethem.Thanks! Warning:Unbrewedheaderfileswerefoundin/usr/local/include. Ifyoudidn'tputthemthereonpurposetheycouldcauseproblemswhen buildingHomebrewformulae,andmayneedtobedeleted. Unexpectedheaderfiles: /usr/local/include/node/ares.h /usr/local/include/node/ares_version.h /usr/local/include/node/libplatform/libplatform.h /usr/local/include/node/nameser.h /usr/local/include/node/node.h /usr/local/include/node/node_buffer.h /usr/local/include/node/node_internals.h /usr/local/include/node/node_object_wrap.h /usr/local/include/node/node_version.h /usr/local/include/node/openssl/aes.h /usr/local/include/node/openssl/asn1.h /usr/local/include/node/openssl/asn1_mac.h /usr/local/include/node/openssl/asn1t.h /usr/local/include/node/openssl/bio.h /usr/local/include/node/openssl/blowfish.h /usr/local/include/node/openssl/bn.h /usr/local/include/node/openssl/buffer.h /usr/local/include/node/openssl/camellia.h /usr/local/include/node/openssl/cast.h /usr/local/include/node/openssl/cmac.h /usr/local/include/node/openssl/cms.h /usr/local/include/node/openssl/comp.h /usr/local/include/node/openssl/conf.h /usr/local/include/node/openssl/conf_api.h /usr/local/include/node/openssl/crypto.h /usr/local/include/node/openssl/des.h /usr/local/include/node/openssl/des_old.h /usr/local/include/node/openssl/dh.h /usr/local/include/node/openssl/dsa.h /usr/local/include/node/openssl/dso.h /usr/local/include/node/openssl/dtls1.h /usr/local/include/node/openssl/e_os2.h /usr/local/include/node/openssl/ebcdic.h /usr/local/include/node/openssl/ec.h /usr/local/include/node/openssl/ecdh.h /usr/local/include/node/openssl/ecdsa.h /usr/local/include/node/openssl/engine.h /usr/local/include/node/openssl/err.h /usr/local/include/node/openssl/evp.h /usr/local/include/node/openssl/hmac.h /usr/local/include/node/openssl/idea.h /usr/local/include/node/openssl/krb5_asn.h /usr/local/include/node/openssl/kssl.h /usr/local/include/node/openssl/lhash.h /usr/local/include/node/openssl/md4.h /usr/local/include/node/openssl/md5.h /usr/local/include/node/openssl/mdc2.h /usr/local/include/node/openssl/modes.h /usr/local/include/node/openssl/obj_mac.h /usr/local/include/node/openssl/objects.h /usr/local/include/node/openssl/ocsp.h /usr/local/include/node/openssl/opensslconf.h /usr/local/include/node/openssl/opensslv.h /usr/local/include/node/openssl/ossl_typ.h /usr/local/include/node/openssl/pem.h /usr/local/include/node/openssl/pem2.h /usr/local/include/node/openssl/pkcs12.h /usr/local/include/node/openssl/pkcs7.h /usr/local/include/node/openssl/pqueue.h /usr/local/include/node/openssl/rand.h /usr/local/include/node/openssl/rc2.h /usr/local/include/node/openssl/rc4.h /usr/local/include/node/openssl/ripemd.h /usr/local/include/node/openssl/rsa.h /usr/local/include/node/openssl/safestack.h /usr/local/include/node/openssl/seed.h /usr/local/include/node/openssl/sha.h /usr/local/include/node/openssl/srp.h /usr/local/include/node/openssl/srtp.h /usr/local/include/node/openssl/ssl.h /usr/local/include/node/openssl/ssl2.h /usr/local/include/node/openssl/ssl23.h /usr/local/include/node/openssl/ssl3.h /usr/local/include/node/openssl/stack.h /usr/local/include/node/openssl/symhacks.h /usr/local/include/node/openssl/tls1.h /usr/local/include/node/openssl/ts.h /usr/local/include/node/openssl/txt_db.h /usr/local/include/node/openssl/ui.h /usr/local/include/node/openssl/ui_compat.h /usr/local/include/node/openssl/whrlpool.h /usr/local/include/node/openssl/x509.h /usr/local/include/node/openssl/x509_vfy.h /usr/local/include/node/openssl/x509v3.h /usr/local/include/node/pthread-fixes.h /usr/local/include/node/smalloc.h /usr/local/include/node/stdint-msvc2008.h /usr/local/include/node/tree.h /usr/local/include/node/uv-aix.h /usr/local/include/node/uv-bsd.h /usr/local/include/node/uv-darwin.h /usr/local/include/node/uv-errno.h /usr/local/include/node/uv-linux.h /usr/local/include/node/uv-sunos.h /usr/local/include/node/uv-threadpool.h /usr/local/include/node/uv-unix.h /usr/local/include/node/uv-version.h /usr/local/include/node/uv-win.h /usr/local/include/node/uv.h /usr/local/include/node/v8-debug.h /usr/local/include/node/v8-platform.h /usr/local/include/node/v8-profiler.h /usr/local/include/node/v8-testing.h /usr/local/include/node/v8-util.h /usr/local/include/node/v8.h /usr/local/include/node/v8config.h /usr/local/include/node/v8stdint.h /usr/local/include/node/zconf.h /usr/local/include/node/zlib.h Warning:YouhaveunlinkedkegsinyourCellar Leavingkegsunlinkedcanleadtobuild-troubleandcausebrewsthatdependon thosekegstofailtorunproperlyoncebuilt.Run`brewlink`onthese: node [[email protected]~]$brewlink Thiscommandrequiresakegargument [[email protected]~]$brewlinknode Linking/usr/local/Cellar/node/0.12.7... Error:Couldnotsymlinkinclude/node/android-ifaddrs.h /usr/local/include/nodeisnotwritable. user1709076 over5years thisworkedforme.iactuallyhadnodeinstalledmanuallywithoutbrew-sotheproblemwascausedbytryingtousebrewtoinstallnodeafternodewasalreadyinstalledmanually newguy over5years Wouldreinstallingthenodeversionfromtheofficialwebsitecreateconflictswiththeoldone?Didyouremovetheoldoneandreinstallorjustdownloadthepkgfileandclicktheinstallbutton? LuisL over4years No,Ijustdownloadedthepkgfromthewebsiteandeverythingworkedwell. EthanParker about4years dumbquestionbutdoyouactuallyrun'whoami'oristhataplaceholderforyourusernameonyourmachine? rosendin almost4years Ifyoutypewhoamiintoyourcommandprompt,you'llseethatitevaluatestothelogged-inuser. MikeS. over3years Ihadtoaddsudochown-R`whoami`:admin/usr/local/lib/dtraceaswell wizeOnes over3years Ihadtorunsudochown-R`whoami`:admin/usr/local/lib/dtraceaswell.Thanks. kpower almost3years Theanswerthatdidhelpin2019(2019-10-16) JeSuisAlrick about1year Ineededtoaddsudochown-R`whoami`:admin/usr/local/lib/node_modules/npm SharifMohammadEunus about1year Thisworkedformein2021.BeforeinstallingbrewI'veinstalledthenodemanuallywhichcausetheerror.Aftertryingsomanythings,this^^finallyworked.Thanksalot. iFreilicht 9months @EthanParkerBacktickswillcausethecommandtobesubstituted,similarto$(whoami).Formoreinfoaboutthedifferencebetweenthetwo,seestackoverflow.com/a/26929799/2533467 MohammadElsayed 4months Niceanswer,theonlythingthatworked,thanks:) Recents WhyamIgettingsomeextra,weirdcharacterswhenmakingafilefromgrepoutput? Unixtoverifyfilehasnocontentandemptylines BASH:cangreponcommandline,butnotinscript SafarioniPadoccasionallydoesn'trecognizeASP.NETpostbacklinks anchortagnotworkinginsafari(ios)foriPhone/iPodTouch/iPad LoggingSOAPrequestandresponseonserverside NovalueatJSONpath"$.name",exception:jsoncannotbenullorempty,UsingMockmvcandSpring-boot DockerMySQL-can'tconnectfromSpringBootapptoMySQLdatabase Howtoaddanobjectinmycollectionbyonlyusingaddmethod? HowtopassaparametertoScikit-LearnKerasmodelfunction Resamplinginscikit-learnand/orpandas Howtovuewatchaspecificpropertyinanarrayofobjects Related InstallingPyqt4withbrew Cannotinstallexpressglobally installGNUm41.4orlateronOSX Whatisthedifferencebetweennodevsnodejscommandinterminal? GlobalNodemodulesnotinstallingcorrectly.Commandnotfound StuckatnpminstallatfechMetadatacheckinginstallablestatus whyIcan'tinstallspecificversionofnpmandhowtodoit? ExpressNode.jsdoesn'twork Autoconfnotlinkedinhomebrew,howtolinkit? HowtoupdateENVvariablesinaProcesswithoutrestartingit(NodeJS)?
延伸文章資訊
- 1brew install npm "npm: command not found" - Stack Overflow
I've tried to run brew install npm , however I just got following response node-5.0.0 already ins...
- 2Node15 on HighSierra: post-install step did not complete ...
I'm unable to complete Node15 install on HighSierra as you can see: $ brew doctor Your system is ...
- 3How to install Node.js and npm on macOS - Fullstack.io
Unfortunately, Homebrew has a habit of installing only the latest version of Node.js. This could ...
- 4【程式】透過Homebrew安裝Node.js(Mac)新增M1 安裝方法
安裝NVM(Node Version Manager)與Node.js 終端機使用指令安裝NVM,並等待安裝完成 $ brew install nvm 之後可查看能安裝的Node.js版本,會列...
- 5Brew Install Npm Npm Command Not Found - FaqCode4U.com
It happened with node also returning command not found, but that I fixed by running brew link nod...