yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.39k stars 2.72k forks source link

EACCES: permission denied error .yarn-integrity #2570

Open francisngo opened 7 years ago

francisngo commented 7 years ago

What is the current behavior?

Getting error when I run yarn from CLI:

yarn install v0.19.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
success Nothing to install.
error An unexpected error occurred: "EACCES: permission denied, open '/Users/[username]/node_modules/.yarn-integrity'".
info If you think this is a bug, please open a bug report with the information provided in "/Users/[username]/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
^Cfs.js:558
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open '/Users/[username]/Library/Caches/Yarn/.roadrunner.json'
    at Object.fs.openSync (fs.js:558:18)
    at Object.fs.writeFileSync (fs.js:1223:33)
    at /usr/local/lib/node_modules/yarn/node_modules/roadrunner/index.js:25:6
    at /usr/local/lib/node_modules/yarn/node_modules/roadrunner/index.js:12:12
    at process.sigint (/usr/local/lib/node_modules/yarn/node_modules/roadrunner/index.js:46:5)
    at emitNone (events.js:91:20)
    at process.emit (events.js:185:7)
    at processEmit [as emit] (/usr/local/lib/node_modules/yarn/node_modules/signal-exit/index.js:155:32)
    at Signal.wrap.onsignal (internal/process.js:200:44)

Please mention your node.js, yarn and operating system version. Node.js v7.4.0 yarn v0.19.1 Mac OS El Capitan v10.11.6

michaelmerrill commented 7 years ago

+1. I'm having the same issue. What is your 'yarn global bin' path? Are you using nvm or n*?

davidcalhoun commented 7 years ago

Suddenly have been having the same issue here, for a week or two. Happens whenever I run any yarn command now.

yarn global bin: /usr/local/bin node v7.2.0 yarn 0.19.1 Mac OSX El Capitan v10.11.6

c0d3rm0nk3y commented 7 years ago

ditto here. i'm trying to install polymer-cli --dev and getting same issue.

environment pi0 w/latest pixel release.

c0d3rm0nk3y commented 7 years ago

it worked when i did 'yarn init' first on the directory i was in even though it was a --dev install.

filev-svt commented 2 years ago

Still happening in on Ubuntu 21.04, yarn commands without sudo work only if node_modules folder is deleted beforehand, which is cumbersome. Otherwise always throws the EACCES error about the .yarn-integrity.