我刚刚构建了一个服务器并安装了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包含的所有文件。 有谁知道发生了什么?
答案 0 :(得分:0)
问题可能是主目录中.npm目录的权限。我姗姗来迟发现这篇文章:
NPM cannot install dependencies - Attempt to unlock something which hasn't been locked
不幸的是,直到我明天上班,我无法证实这一点。