【问题标题】:Error while installing any NPM module安装任何 NPM 模块时出错
【发布时间】:2017-06-14 15:06:32
【问题描述】:

我是 webDevelopment 的新手。我正在尝试使用 npm install grunt-contrib-watch --save-dev 安装 npm 模块,但出现此错误 -

npm WARN npm npm does not support Node.js v0.10.37
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/
npm ERR! Object function (err) {
npm ERR!         if (err) return cb(err)
npm ERR!         fs.fsync(fd, function (err) {
npm ERR!           if (err) return cb(err)
npm ERR!           fs.close(fd, cb)
npm ERR!         })
npm ERR!       } has no method 'toLowerCase'

我也尝试安装节点 latet 版本,它给了我同样的结果。

我的版本是 -

Node - v0.10.37
npm  - 4.6.1

我该如何解决这个问题?

【问题讨论】:

  • 节点 v0.10.37 -> npm v1.4.28 检查this
  • 你需要更新你的nodejs

标签: javascript angularjs node.js npm


【解决方案1】:

您使用的那个版本的 npm 不能很好地与您使用的 node 版本配合使用。

对于该版本的节点,支持的 npm 版本是 2.15.1

我建议安装类似 nvm https://github.com/creationix/nvm/blob/master/README.md 的东西,它将为您处理兼容版本的安装。

您可以使用nvm use 10.0.10 使用任何您喜欢的节点版本,它将使用节点的 10.0.10 版本和 npm 的 2.15.1 版本。

【讨论】:

    猜你喜欢
    • 2018-11-22
    • 1970-01-01
    • 2016-09-06
    • 2020-04-30
    • 2022-01-25
    • 2013-07-28
    • 2023-04-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多