Encountering a similar challenge while using Debian 12, I faced an issue with eslint not being in my PATH despite being installed globally via npm install -g eslint
. To resolve this, I had to include my user's global node bin directory in my path ($HOME/.local/share/node/bin). However, even after fixing that, I encountered the same problem as you.
~/Documents/some-project$ npm init @eslint/config
sh: 1: create-config: not found
npm ERR! code 127
npm ERR! path /home/$USER/Documents/some-project
npm ERR! command failed
npm ERR! command sh -c create-config
npm ERR! A complete log of this run can be found in: /home/$USER/.npm/_logs/2023-11-10T16_09_14_958Z-debug-0.log
To address this issue, I needed to add another directory to the path since it turned out that create-config was located in $HOME/.npm/_npx/bin/
Once both directories were added to my PATH, setting up configuration for eslint finally succeeded. Below is a line you can append to the end of your ~/.bashrc file to include both path additions:
export PATH=$HOME/.npm/_npx/bin/:$HOME/.local/share/node/bin:$PATH
Please remember to start a new bash session for these changes to take effect. Furthermore, some linter integrations may require separate configuration to modify the PATH environment variable if they do not interact through bash.