Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda