尝试更新到Meteor 0.8.1.1后,我收到一个npm错误,它无法解锁connect@2.9.0。我已经删除并重新添加了铁路由器,但无济于事。还运行npm cache clean,另一个stackoverflow解决方案建议类似的问题。任何建议都表示赞赏。
iron-router: updating npm dependencies -- connect...
npm WARN using --force I sure hope you know what you are doing.
npm ERR! Error: Attempt to unlock connect@2.9.0, which hasn't been locked
npm ERR! at unlock (/home/twisted/.meteor/tools/43b8566b9f/lib/node_modules/npm/lib/cache.js:1304:11)
npm ERR! at cb (/home/twisted/.meteor/tools/43b8566b9f/lib/node_modules/npm/lib/cache.js:646:5)
npm ERR! at /home/twisted/.meteor/tools/43b8566b9f/lib/node_modules/npm/lib/cache.js:655:20
npm ERR! at /home/twisted/.meteor/tools/43b8566b9f/lib/node_modules/npm/lib/cache.js:1290:7
npm ERR! at /home/twisted/.meteor/tools/43b8566b9f/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38
npm ERR! at OpenReq.Req.done (/home/twisted/.meteor/tools/43b8566b9f/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:144:5)
npm ERR! at OpenReq.done (/home/twisted/.meteor/tools/43b8566b9f/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.2.0-61-generic
npm ERR! command "/home/twisted/.meteor/tools/43b8566b9f/bin/node" "/home/twisted/.meteor/tools/43b8566b9f/bin/npm" "install" "--force" "connect@2.9.0"
npm ERR! cwd /home/twisted/.meteorite/packages/iron-router/EventedMind/iron-router/d1ffb3f06ea4c112132b030f2eb1a70b81675ecb/.npm/package-new-1u1tvv2
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/twisted/.meteorite/packages/iron-router/EventedMind/iron-router/d1ffb3f06ea4c112132b030f2eb1a70b81675ecb/.npm/package-new-1u1tvv2/npm-debug.log
npm ERR! not ok code 0
=> Errors while scanning packages:
While building package `iron-router`:
error: couldn't install npm package
答案 0 :(得分:2)
首先,验证您的.npm
目录不包含root
所拥有的子目录:
find ~/.npm -type d -exec ls -ld {} \; | grep root
如果是,您可能在过去的某个时刻执行了一些sudo npm
命令。要解决此问题,请更新目录权限:
sudo chown -R $USER ~/.npm
如果这不起作用,请尝试升级到最新版本的npm:
npm update npm -g
如果这不起作用,请尝试运行sudo meteor
以查看meteor是否会成功更新所有过期的npm软件包。
答案 1 :(得分:0)
Meteor在每个包中包含npm dependancies。尝试转到/home/twisted/.meteorite/packages/iron-router
并删除iron-router
包。然后运行mrt update
,然后再次尝试运行您的应用。这应该清理你的问题。可悲的是,当我升级安装了IronRouter的应用程序时,我无法重现这一点。如果您仍然遇到此问题,请发布您正在使用的IronRouter版本。
答案 2 :(得分:0)
想出我现在需要以超级用户身份运行更新和某些包添加,而我在升级之前没有。