You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran brew update and am still able to reproduce my issue.
I have resolved all warnings from brew doctor and that did not fix my problem.
What were you trying to do (and why)?
Install packages via npm
e.g., npm i -g jq
What happened (include all command output)?
The installation succeeds, but npm seems to have been hijacked to install in /opt/homebrew
which jq
/opt/homebrew/bin/jq
This causes conflicts -- e.g.,
▶ jq
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module 'commander'
Require stack:
- /opt/homebrew/lib/node_modules/jq/bin/jq
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/opt/homebrew/lib/node_modules/jq/bin/jq:7:15)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/opt/homebrew/lib/node_modules/jq/bin/jq' ]
}
If I remove the brew profile script eval "$(/opt/homebrew/bin/brew shellenv)", then all globally install npm scripts are gone. If I re-install them then it works fine.
If someone installs npm from brew, corepack doesn't seem to be able to shim it anymore.
Can't even uninstall with brew uninstall npm, have to rm -rf /opt/homebrew/bin/npm.
brew config
outputbrew doctor
outputVerification
brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Install packages via npm
e.g.,
npm i -g jq
What happened (include all command output)?
The installation succeeds, but npm seems to have been hijacked to install in
/opt/homebrew
This causes conflicts -- e.g.,
If I remove the brew profile script eval
"$(/opt/homebrew/bin/brew shellenv)"
, then all globally install npm scripts are gone. If I re-install them then it works fine.What did you expect to happen?
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: