Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Error: Attempt to unlock fsevents@0.1.6, which hasn't been locked #4869

Closed
deepwell opened this issue Mar 12, 2014 · 5 comments
Closed

Error: Attempt to unlock fsevents@0.1.6, which hasn't been locked #4869

deepwell opened this issue Mar 12, 2014 · 5 comments

Comments

@deepwell
Copy link

Cannot install karma
sudo npm install -g karma

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/Cellar/node/0.10.26/bin/node',
1 verbose cli   '/usr/local/Cellar/node/0.10.26/bin/npm',
1 verbose cli   'install',
1 verbose cli   'fsevents@0.1.6',
1 verbose cli   'recursive-readdir@0.0.2' ]
2 info using npm@1.4.3
3 info using node@v0.10.26
4 verbose cache add [ 'fsevents@0.1.6', null ]
5 verbose cache add name=undefined spec="fsevents@0.1.6" args=["fsevents@0.1.6",null]
6 verbose parsed url { protocol: null,
6 verbose parsed url   slashes: null,
6 verbose parsed url   auth: null,
6 verbose parsed url   host: null,
6 verbose parsed url   port: null,
6 verbose parsed url   hostname: null,
6 verbose parsed url   hash: null,
6 verbose parsed url   search: null,
6 verbose parsed url   query: null,
6 verbose parsed url   pathname: 'fsevents@0.1.6',
6 verbose parsed url   path: 'fsevents@0.1.6',
6 verbose parsed url   href: 'fsevents@0.1.6' }
7 verbose cache add name="fsevents" spec="0.1.6" args=["fsevents","0.1.6"]
8 verbose parsed url { protocol: null,
8 verbose parsed url   slashes: null,
8 verbose parsed url   auth: null,
8 verbose parsed url   host: null,
8 verbose parsed url   port: null,
8 verbose parsed url   hostname: null,
8 verbose parsed url   hash: null,
8 verbose parsed url   search: null,
8 verbose parsed url   query: null,
8 verbose parsed url   pathname: '0.1.6',
8 verbose parsed url   path: '0.1.6',
8 verbose parsed url   href: '0.1.6' }
9 verbose addNamed [ 'fsevents', '0.1.6' ]
10 verbose addNamed [ '0.1.6', '0.1.6' ]
11 verbose cache add [ 'recursive-readdir@0.0.2', null ]
12 verbose cache add name=undefined spec="recursive-readdir@0.0.2" args=["recursive-readdir@0.0.2",null]
13 verbose parsed url { protocol: null,
13 verbose parsed url   slashes: null,
13 verbose parsed url   auth: null,
13 verbose parsed url   host: null,
13 verbose parsed url   port: null,
13 verbose parsed url   hostname: null,
13 verbose parsed url   hash: null,
13 verbose parsed url   search: null,
13 verbose parsed url   query: null,
13 verbose parsed url   pathname: 'recursive-readdir@0.0.2',
13 verbose parsed url   path: 'recursive-readdir@0.0.2',
13 verbose parsed url   href: 'recursive-readdir@0.0.2' }
14 verbose cache add name="recursive-readdir" spec="0.0.2" args=["recursive-readdir","0.0.2"]
15 verbose parsed url { protocol: null,
15 verbose parsed url   slashes: null,
15 verbose parsed url   auth: null,
15 verbose parsed url   host: null,
15 verbose parsed url   port: null,
15 verbose parsed url   hostname: null,
15 verbose parsed url   hash: null,
15 verbose parsed url   search: null,
15 verbose parsed url   query: null,
15 verbose parsed url   pathname: '0.0.2',
15 verbose parsed url   path: '0.0.2',
15 verbose parsed url   href: '0.0.2' }
16 verbose addNamed [ 'recursive-readdir', '0.0.2' ]
17 verbose addNamed [ '0.0.2', '0.0.2' ]
18 silly lockFile bda43ddf-fsevents-0-1-6 fsevents@0.1.6
19 error Error: Attempt to unlock fsevents@0.1.6, which hasn't been locked
19 error     at unlock (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/cache.js:1304:11)
19 error     at cb (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/cache.js:646:5)
19 error     at /usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/cache.js:655:20
19 error     at /usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/cache.js:1282:20
19 error     at afterMkdir (/usr/local/Cellar/node/0.10.26/lib/node_modules/npm/lib/cache.js:1013:14)
19 error     at /usr/local/Cellar/node/0.10.26/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
19 error     at Object.oncomplete (fs.js:107:15)
20 error If you need help, you may report this *entire* log,
20 error including the npm and node versions, at:
20 error     <http://github.com/npm/npm/issues>
21 error System Darwin 13.1.0
22 error command "/usr/local/Cellar/node/0.10.26/bin/node" "/usr/local/Cellar/node/0.10.26/bin/npm" "install" "fsevents@0.1.6" "recursive-readdir@0.0.2"
23 error cwd /usr/local/lib/node_modules/karma/node_modules/chokidar
24 error node -v v0.10.26
25 error npm -v 1.4.3
26 verbose exit [ 1, true ]

This SO answer didn't help: http://stackoverflow.com/questions/22152162/npm-cannot-install-dependencies-attempt-to-unlock-something-which-hasnt-been/22207869#22207869

@maayan-myheritage
Copy link

Same error:

Executing npm install fsevents@0.1.6 recursive-readdir@0.0.2
npm ERR! Error: Attempt to unlock fsevents@0.1.6, 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 Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "fsevents@0.1.6" "recursive-readdir@0.0.2"
npm ERR! cwd /usr/local/lib/node_modules/karma/node_modules/chokidar
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! Error: Attempt to unlock recursive-readdir@0.0.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 Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "fsevents@0.1.6" "recursive-readdir@0.0.2"
npm ERR! cwd /usr/local/lib/node_modules/karma/node_modules/chokidar
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!     /usr/local/lib/node_modules/karma/node_modules/chokidar/npm-debug.log
npm ERR! not ok code 0

@deepwell
Copy link
Author

I fixed my environment by doing the following:

sudo rm -rf /usr/local/lib/node_modules/*
npm install -g karma

And install any other global node modules you require without sudo

@verlok
Copy link

verlok commented Mar 18, 2014

Same issue to me
Didn't solve using the solution @deepwell suggested :(

@MaerF0x0
Copy link

if sudo rm -rf /usr/local/lib/node_modules/* leaves you without npm ,you can get again by reinstalling node.

I also had to sudo chmod a+w /usr/local/lib/node_modules to get karma to install

@othiym23
Copy link
Contributor

I believe this issue has been addressed by the resolution to #6043, which is included in the latest stable version of npm, npm@2.0.0. Please upgrade npm and this problem should go away. Thanks for your patience!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants