macos - 重启后找不到 npm 命令

标签 macos node.js terminal npm

npm 命令在计算机重启后一直无法识别:

-bash: npm: command not found

node 命令仍然可以正常工作,只是 npm 不工作。我必须从主站点重新安装 Node.js 才能让它再次运行。

~/bin 被添加到我的 .bash_profile 中的 $PATH 中:

export PATH="$HOME/bin:$PATH"

编辑:我也在使用完整的 mathiasbynens/dotfiles它管理自己的版本,我想知道这里是否存在冲突。

最佳答案

根据 nvm readme file ,尝试运行一次:

nvm alias default stable

这将设置一个默认的 Node 版本以用于任何新的 shell。

关于macos - 重启后找不到 npm 命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19951991/

相关文章:

c++ - 在 OS X/Mac 上使用 Windows 蓝牙 API?

objective-c - 使用 Cocoa 为文件夹创建图标

node.js - 在 Mac OS : "Connection refused! Is selenium server started?" 上使用 Nightwatchjs 在 Chrome 中启动测试

macos - 未调用热键回调的事件 Tap(CFMachPortRef) 问题

linux - 增加到 node.js/socket.io 的最大连接

node.js - 如何对 Google Datastore 中的大量实体进行求和?

终端颜色

node.js - 对不同端口中不同应用程序的 http 请求

python - 如何增加 Paramiko SSH 客户端上的向后滚动缓冲区?

c - 在 C、Linux 中递归列出目录和文件时出现段错误(核心已转储)