安装 Heroku Toolbelt 后无法识别 npm

npm not recognised after installing Heroku Toolbelt

我已经在 Windows 7 系统上安装了 Heroku Toolbelt (https://toolbelt.heroku.com/)。

我按照教程到这里:https://devcenter.heroku.com/articles/getting-started-with-nodejs#declare-app-dependencies

当我 运行 命令 npm install 时出现以下错误:

'npm' 不是内部或外部命令,也不是可运行的程序或批处理文件。

我明白这意味着它不能 find/execute npm。但这是从 Heroku 自己的 tutorial/documentation 开始的,并没有说你需要安装任何其他东西才能让它工作。当我访问 npm 网站 (https://www.npmjs.com/) 时,它还显示:

npm 命令行工具与 Node.js 捆绑在一起。如果你已经安装了它,那么你也已经有了 npm。

这有问题!

尝试重新安装nodejs。或者,您可以为 windows 安装 nvm,它是 nodejs 的版本管理器。它非常有用且易于安装。在 https://github.com/coreybutler/nvm-windows

查看