【问题标题】:NPM Install error with Phoenix FrameworkPhoenix 框架的 NPM 安装错误
【发布时间】:2016-05-01 09:56:39
【问题描述】:

我在 debian jessie 上,我正在尝试设置 phoenix 框架。我使用 mix phoenix.new 创建了一个新的 phoenix 应用程序,然后进入该文件夹。当我运行“npm install”时,出现以下错误:

sudo npm install
npm ERR! git clone git@github.com:file:deps/phoenix_html Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-file-deps-phoenix-html-50a27b71'...
npm ERR! git clone git@github.com:file:deps/phoenix_html Permission denied (publickey).
npm ERR! git clone git@github.com:file:deps/phoenix_html fatal: Could not read from remote repository.
npm ERR! git clone git@github.com:file:deps/phoenix_html 
npm ERR! git clone git@github.com:file:deps/phoenix_html Please make sure you have the correct access rights
npm ERR! git clone git@github.com:file:deps/phoenix_html and the repository exists.
npm ERR! 404 Not Found
npm ERR! 404 
npm ERR! 404 'phoenix_html' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 3.16.0-4-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/andy/Phoenix/test_phoenix
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR! git clone git@github.com:file:deps/phoenix Cloning into bare repository '/root/.npm/_git-remotes/git-github-com-file-deps-phoenix-c83d6c1a'...
npm ERR! git clone git@github.com:file:deps/phoenix Permission denied (publickey).
npm ERR! git clone git@github.com:file:deps/phoenix fatal: Could not read from remote repository.
npm ERR! git clone git@github.com:file:deps/phoenix 
npm ERR! git clone git@github.com:file:deps/phoenix Please make sure you have the correct access rights
npm ERR! git clone git@github.com:file:deps/phoenix and the repository exists.
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/andy/Phoenix/test_phoenix/npm-debug.log
npm ERR! not ok code 0

有什么问题?

【问题讨论】:

  • phoenix_html 只是 doesn't exist 在 npm 上
  • @peteb 是对的,但我还想补充一点,您也可以在 npm 包上添加本地依赖项,这似乎就是这里发生的事情。 file:deps 表示您没有为 phoenix 框架提取一​​些本地依赖项。
  • 这意味着你可能需要做mix deps.get,因为phoenix_html 是phoenix 的一个长生不老药。
  • 我在 ubuntu 14.04lts 上遇到了完全相同的问题。 phoenix.new 的 npm install 似乎可以正常工作,因为没有错误消息。 mix deps.get 解决得很好,并且所有依赖项都已安装。手动运行时仍然 npm install 失败。
  • 我终于用更新节点和 npm 通过 brew 将它修复到最新版本。

标签: npm elixir phoenix-framework


【解决方案1】:

使用 nvm 安装最新版本的方法之一。对我来说这很有帮助。首先删除旧版本。

sudo apt-get remove nodejs

并安装最新的

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
nvm install 5.0
nvm use 5.0

【讨论】:

    【解决方案2】:

    我遇到了同样的错误,然后意识到我使用的是旧版本的节点。解决方案是将节点更新到比v5.0.0 更新的版本。

    【讨论】:

      猜你喜欢
      • 2016-04-29
      • 2017-08-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多