Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

234
Visualizações
Node and npm not found after restarting macOS

I am using my corporate's laptop and am a new mac User (used Ubuntu before) :

  • OS: macOS Monterey Version 12.2

There are two accounts, administrator and mine - I don't have sudo rights. To install homebrew without administrator rights, I followed this Installation.

To install the node - I used brew install node. Both node -v and npm -v were working. When I restarted the laptop, I cannot find node/npm.

On running $ node -v, I get -bash: node: command not found (I changed my default terminal from zsh to bash and the output is the same for both of them)

I tried this solution but couldn't find nvm in the system. Am new to mac and I believe nvm is some kind of package manager like homebrew so this solution is not applicable to me (correct me if I am wrong).

How can I install things in my system without sudo rights and keep them permanently(like node)?

EDIT:

  • (After adding brew to the PATH) On running - brew list|grep node, I got - node

  • $ echo $PATH gives /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/parthkapadia/homebrew/bin

EDIT2:

  • Adding brew to path solved the issue, now I can even access node and npm (even after restarting). I used this site to add homebrew/bin to path (in zsh terminal)
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The issue was homebrew's path. It was not added to the PATH variable. When I restarted the system, homebrew was no longer in the PATH (as it was temporarily added probably when I installed it). As homebrew was not added to PATH, the terminal didn't recognize brew or any package installed using it like node or npm.

I solved it by adding Users/username/homebrew/bin to PATH. The steps I followed are -

  • cd - to move to the home directory
  • touch .zshrc to create .zshrc file as it didn't exist
  • nano .zshrc to open the file for editing
  • Added export PATH=$PATH:/Users/yourusername/homebrew/bin in the file (this appends homebrew/bin to the PATH variable)

Now the terminal can recognize brew and hence node and npm too. Refer this for more detailed explanation on how to add to PATH in macOS.

Thanks to all the people who helped in the comments.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda