node.js - npm - ENOENT,打开 <当前目录>/null

标签 node.js npm

我正在运行 ubuntu 12.04,但我的 npm 停止工作:

$ npm 缓存清理 错误:ENOENT,打开“/home/jasonshark/null”

我有 npm 1.4.21 和 Node 0.10.30

每当我尝试使用 npm 执行任何操作时,我在所在的目录后都会得到 null。这是怎么回事?

最佳答案

我也遇到了同样的问题,这是一个 nopt bug

打开/usr/lib/node_modules/npm/node_modules/npmconf/node_modules/nopt/lib/nopt.js并在第127行

function validatePath (data, k, val) {
  if (val === true) return false
  if (val === null) return true // <-- ADD THIS LINE !
  data[k] = path.resolve(String(val))
  return true
}

reference

关于node.js - npm - ENOENT,打开 <当前目录>/null,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25091276/

相关文章:

node.js - react native Node 依赖项安装破坏了项目

android - 获取计步器数据的最佳方式 React Native

node.js - 如何使用 loopback.io 在 REST 中包含相关实体

node.js - 更新命令 mongoskin 后的对象 ID

javascript - 在 express js 中发送后无法设置标题

javascript - npm 安装,-force 标志

node.js - 由于 imagemin 问题,Grunt 构建失败,出了什么问题?

node.js - S3 存储桶 Lambda 事件 : Unable to validate the following destination configurations

ios - 对 MS Graph API 的请求给了我 "Authorization Request Denied - Insufficient privileges to complete the operation"

node.js - 使用 NPM 更新包时出错