【问题标题】:fails installing node package using npm on debian在 debian 上使用 npm 安装节点包失败
【发布时间】:2014-03-10 17:10:48
【问题描述】:

我刚刚构建了一个服务器并安装了 NodeJS(从源代码编译)。我可以使用 npm 安装全局包,但不能在本地安装任何东西:

$ npm install restify
npm ERR! Error: Attempt to unlock restify@~2.6.2, which hasn't been locked
npm ERR!     at unlock (/usr/local/lib/node_modules/npm/lib/cache.js:1304:11)
npm ERR!     at cb (/usr/local/lib/node_modules/npm/lib/cache.js:646:5)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:655:20
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:1290:7
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38
npm ERR!     at OpenReq.Req.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:144:5)
npm ERR!     at OpenReq.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:64:22)
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "restify"
npm ERR! cwd /home/likewise-open/COVENTRY/aa7401/bookshop
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/likewise-open/.../npm-debug.log
npm ERR! not ok code 0
$ 

我正在运行当前版本的 node 和 npm:

$ node -v
v0.10.26
$ npm -v
1.4.3
$

我的请求包也有同样的问题。 我是该文件夹和 int 包含的所有文件的所有者。 有谁知道怎么回事?

【问题讨论】:

    标签: linux node.js debian npm


    【解决方案1】:

    问题可能是主目录中 .npm 目录的权限。我很晚才发现这篇文章:

    NPM cannot install dependencies - Attempt to unlock something which hasn't been locked

    很遗憾,直到我明天上班之前,我都无法确认这一点。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-09
      • 2016-10-15
      • 1970-01-01
      • 1970-01-01
      • 2020-02-06
      • 2020-10-29
      相关资源
      最近更新 更多