Node.js Heroku安装错误
我一直在努力让heroku在我的mac上工作。我已经安装了Heroku工具带。但当我在zsh控制台上运行“heroku login”时,会出现以下错误:Node.js Heroku安装错误,node.js,macos,heroku,heroku-toolbelt,Node.js,Macos,Heroku,Heroku Toolbelt,我一直在努力让heroku在我的mac上工作。我已经安装了Heroku工具带。但当我在zsh控制台上运行“heroku login”时,会出现以下错误: $ heroku login heroku-cli: Installing core plugins... ▸ npm ERR! Darwin 15.3.0 ▸ npm ERR! argv "/Users/Deepen/.heroku/node-v5.4.1-darwin-x64/bin/node" "/Users/Deep
$ heroku login
heroku-cli: Installing core plugins...
▸ npm ERR! Darwin 15.3.0
▸ npm ERR! argv "/Users/Deepen/.heroku/node-v5.4.1-darwin-x64/bin/node"
"/Users/Deepen/.heroku/node-v5.4.1-darwin-x64/lib/node_modules/npm/cli.js"
"remove" "heroku-apps" "heroku-cli-addons" "heroku-fork" "heroku-git"
"heroku-local" "heroku-run" "heroku-spaces" "heroku-status"
▸ npm ERR! node v5.4.1
▸ npm ERR! npm v3.3.10
▸ npm ERR! code MODULE_NOT_FOUND
▸
▸ npm ERR! Cannot find module 'npm-autoinit/autoinit'
▸ npm ERR!
▸ npm ERR! If you need help, you may report this error at:
▸ npm ERR! <https://github.com/npm/npm/issues>
▸ npm WARN ENOENT ENOENT: no such file or directory, open '/Users/Deepen/.heroku/package.json'
▸ npm WARN EPACKAGEJSON .heroku No description
▸ npm WARN EPACKAGEJSON .heroku No repository field.
▸ npm WARN EPACKAGEJSON .heroku No README data
▸ npm WARN EPACKAGEJSON .heroku No license field.
▸ npm ERR! Darwin 15.3.0
▸ npm ERR! argv "/Users/Deepen/.heroku/node-v5.4.1-darwin-x64/bin/node" "/Users/Deepen/.heroku/node-v5.4.1-darwin-x64/lib/node_modules/npm/cli.js" "remove" "heroku-apps" "heroku-cli-addons" "heroku-fork" "heroku-git" "heroku-local" "heroku-run" "heroku-spaces" "heroku-status"
▸ npm ERR! node v5.4.1
▸ npm ERR! npm v3.3.10
▸
▸ npm ERR! Callback called more than once.
▸ npm ERR!
▸ npm ERR! If you need help, you may report this error at:
▸ npm ERR!
▸
▸ npm ERR! Please include the following file with any support request:
▸ npm ERR! /Users/Deepen/.heroku/npm-debug.log
▸ exit status 1
heroku-cli: Installing core plugins (retrying)...
$heroku登录
heroku cli:正在安装核心插件。。。
▸ npm错误!达尔文15.3.0
▸ npm错误!argv“/Users/deeph/.heroku/node-v5.4.1-darwin-x64/bin/node”
“/Users/depend/.heroku/node-v5.4.1-darwin-x64/lib/node_modules/npm/cli.js”
“删除”“heroku应用”“heroku cli插件”“heroku fork”“heroku git”
“heroku本地”“heroku运行”“heroku空间”“heroku状态”
▸ npm错误!节点v5.4.1
▸ npm错误!npm v3.3.10
▸ npm错误!找不到代码模块
▸
▸ npm错误!找不到模块“npm autoinit/autoinit”
▸ npm错误!
▸ npm错误!如果需要帮助,您可以在以下位置报告此错误:
▸ npm错误!
▸ npm WARN ENOUNT ENOUNT:没有这样的文件或目录,请打开“/Users/depend/.heroku/package.json”
▸ npm WARN EPACKAGEJSON.heroku无描述
▸ npm WARN EPACKAGEJSON.heroku无存储库字段。
▸ npm WARN EPACKAGEJSON.heroku没有自述文件数据
▸ npm WARN EPACKAGEJSON.heroku无许可证字段。
▸ npm错误!达尔文15.3.0
▸ npm错误!argv“/Users/deeph/.heroku/node-v5.4.1-darwin-x64/bin/node”“/Users/deeph/.heroku/node-v5.4.1-darwin-x64/lib/node_modules/npm/cli.js”“删除”“heroku应用”“heroku cli插件”“heroku分叉”“heroku git”“heroku本地”“heroku运行”“heroku空间”“heroku状态”
▸ npm错误!节点v5.4.1
▸ npm错误!npm v3.3.10
▸
▸ npm错误!多次调用回调。
▸ npm错误!
▸ npm错误!如果需要帮助,您可以在以下位置报告此错误:
▸ npm错误!
▸
▸ npm错误!请在任何支持请求中包括以下文件:
▸ npm错误/Users/deeph/.heroku/npm-debug.log
▸ 退出状态1
heroku cli:正在安装核心插件(重试)。。。
我刚刚发布了一个修复程序,请您更新heroku并重试好吗?以下是我所做的修复工作
我检查了我的系统(Mac El Capitan)上节点5.9.1的安装位置:
然后我在~/.heroku下复制了整个内容,并更改了目录的名称:
cp -r ~/.nvm/versions/node/v5.9.1 ~/.heroku
mv ~/.heroku/v5.9.1 ~/.heroku/node-v5.9.1-darwin-x64
这对我起到了作用,希望它也能帮助其他人,因为我花了很长时间才弄明白。你的文章中有关于
npm autoinit/autoinit
的参考吗?@RansomBriggs是的,我有。但问题依然存在@请删除~/.heroku
并再次运行heroku更新
,好吗?这将清除您所有的旧安装文件,并安装最新版本(4.27.21-839acbb
)@deep您如何使用npm autoinit/autoinit
我假设它是加载脚本的一部分,请告诉我您是否以其他方式使用它。@Ransom Briggs,请看我的问题belowI也有类似的问题,错误消息有些不同(在/home/lonnon/.heroku中找不到packages.json),但它是通过类似的方法解决的。我用sudo apt get--purge remove heroku_toolbelt
删除了工具带,然后删除了~/.heroku
目录。从最初的install-ubuntu.sh脚本重新安装后,我在命令行上运行了heroku
。heroku cli在“安装核心插件”步骤中再次失败,但在再次运行之后(在核心插件步骤中等待了很长时间),它最终成功了。
cp -r ~/.nvm/versions/node/v5.9.1 ~/.heroku
mv ~/.heroku/v5.9.1 ~/.heroku/node-v5.9.1-darwin-x64