【问题标题】:Unable to install Ember.js无法安装 Ember.js
【发布时间】:2016-08-17 20:35:20
【问题描述】:

我正在尝试安装 Ember CLI,但出现错误,我没有得到我真正需要做的事情。

我正在运行以下命令在我的 C 盘中安装 Ember CLI:

npm install -g ember-cli

我收到以下错误:

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ember-cli"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ember-cli"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2
npm ERR! path C:\npm-debug.log.9900b075918cf81d21ff4fa7a56e3bc6
npm ERR! code EPERM
npm ERR! errno -4048

npm ERR! Error: EPERM, open 'C:\npm-debug.log.9900b075918cf81d21ff4fa7a56e3bc6'
npm ERR!     at Error (native)
npm ERR!  { [Error: EPERM, open 'C:\npm-debug.log.9900b075918cf81d21ff4fa7a56e3bc6']
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   path: 'C:\\npm-debug.log.9900b075918cf81d21ff4fa7a56e3bc6' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\npm-debug.log

更新:

    C:\>npm install -g ember-cli
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ember-cli"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.2
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     C:\npm-debug.log

【问题讨论】:

  • Node、npm 和 ember-cli 不能很好地与 windows 配合使用,从外观上看,您需要以管理员身份运行终端。
  • 嗨@Kitler 即使在以管理员身份运行后,我也收到错误消息。我用新的错误更新了问题。
  • this 有帮助吗?

标签: ember.js ember-cli


【解决方案1】:

我已经解决了这个问题。主要是网络问题。我已启用代理以供节点用于下载文件。

【讨论】:

    【解决方案2】:

    发生这种情况是因为要使用 npm 全局安装某些东西,您必须是 root 或管理员。在 windows 中右键单击终端应用程序,然后单击以管理员身份运行选项。在 Mac 和 linux 上,您只需在命令前加上 sudo

    【讨论】:

    • 在 Mac 和 linux 上,您可以正确安装 npm 并避免 sudoing :)
    • C:\>npm install -g ember-cli npm ERR!网络连接 ETIMEDOUT npm ERR!网络 这很可能不是 npm 本身的问题 npm ERR!网络,与网络连通性有关。 npm 错误!网络 在大多数情况下,您使用代理服务器或网络设置错误。 npm 错误!网络 npm 错误!网络 如果您在代理后面,请确保 npm ERR!网络“代理”配置设置正确。请参阅:'npm help config' npm ERR!请在任何支持请求中包含以下文件:npm ERR! C:\npm-debug.log
    • 即使以管理员身份运行后,我也遇到了同样的问题
    猜你喜欢
    • 1970-01-01
    • 2021-07-26
    • 2020-10-12
    • 2023-01-30
    • 2014-01-08
    • 2011-10-17
    • 2018-06-04
    • 2014-12-05
    • 2015-12-28
    相关资源
    最近更新 更多