pnpm: Error: Unable to update lock within the stale threshold

Code to reproduce

pnpm install

Actual behavior:

pnpm starts to install packages in node_modules/.resolutions then fails with only 300 of them installed (1000 to be installed). node.exe process memory goes up to 800MB and exits with the following error. Running the command again installs a few more packages each time (around 5). Please note that i have 11GB RAM free before running the command 😃

C:\Users\aecz\AppData\Roaming\nvm\v6.9.4\node_modules\pnpm\lib\node_modules\proper-lockfile\index.js:180
    compromised = compromised || function (err) { throw err; };
                                                  ^
Error: Unable to update lock within the stale threshold
    at options.fs.utimes (C:\Users\aecz\AppData\Roaming\nvm\v6.9.4\node_modules\pnpm\lib\node_modules\proper-lockfile\index.js:108:66)
    at FSReqWrap.oncomplete (fs.js:123:15)

Additional information:

pnpm-debug.log.txt

  • pnpm 0.50.0
  • node 6.9.4
  • Windows 7

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 28 (21 by maintainers)

Commits related to this issue

Most upvoted comments

I created a PR to remove locking #2553

@nickpape-msft sounds great, maybe you could move that logic to a separate package and then we’ll be able to substitute proper-lockfile in @pnpm/fs-locker

(FWIW we generally avoid creating tiny NodeJS packages with only 300 lines of code in them. It’s bad for performance. Also, the more individual dependencies you have, the harder it is to avoid side-by-side versions.)

@zkochan I just got the error again on Ubuntu 16 with a completely warm store.

Resolving: total 2040, reused 1672, downloaded 0
/usr/local/lib/node_modules/pnpm/node_modules/proper-lockfile/index.js:186
    compromised = compromised || function (err) { throw err; };
                                                  ^

Error: Unable to update lock within the stale threshold
    at options.fs.utimes (/usr/local/lib/node_modules/pnpm/node_modules/proper-lockfile/index.js:108:66)
    at FSReqWrap.oncomplete (fs.js:135:15)

Happens at random package installs.

Resolving: total 2040, reused 1672, downloaded 0
pnpm i --lock-stale-duration=0
Resolving: total 2040, reused 1972, downloaded 0
Resolving: total 2040, reused 1991, downloaded 0

At then end the reused counter starts to slow down and stall, and then the error comes.


--no-lock seems to have allowed it to finish. It becomes really slow at the end though. Maybe there is a memory leak or some inefficient code…

--no-lock released with v0.67.0