Need to add yarn's global module install location to the NODE_PATH when resolving the node module. Something comparable to npm config get prefix
For those wondering, a workaround on Linux is to set the following:
eslint._legacyModuleResolve: true,
eslint.nodePath: "/your/home/dir/.config/yarn/global/node_modules/"
eslint.nodePath doesn't seem to fix this on Mac
Does anyone know how to determine the global module location for yarn. I tried yarn config get prefix and yarn config listbut nothing contains the global install location.
Under Windows is seems to be ~\AppData\Local\Yarn\config\global\node_modules.
yarn global bin ?
yarn global bin prints the same as npm config get prefix however this is not the location yarn installs global npm modules. I am still a little lost here.
@eduedix thanks for opening the yarn issue.
@dbaeumer I reached out to the FB team and pointed them at this issue. Hoping they'll jump in and help.
@reybango thanks. I retested this today and yarn still doesn't provide me with command to find the global node modules install location.
Added a PR here: https://github.com/yarnpkg/yarn/pull/4522
Released Yarn 1.1.0 with this PR merged.
@BYK Thanks!
See https://github.com/Microsoft/vscode-eslint/blob/master/README.md#settings-options how to enable this.
Indeed, there is nothing to do with yarn, just add "eslint.packageManager": "yarn" to your vscode settings and it would fix at all :)
Most helpful comment
For those wondering, a workaround on Linux is to set the following: