Closed Bug 1211478 Opened 9 years ago Closed 9 years ago

Cannot use ./mach eslint on Mac

Categories

(Firefox Build System :: Mach Core, enhancement)

Unspecified
macOS
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: pbro, Assigned: miker)

References

Details

Here is what I did: - updated my clone of fx-team today - in the terminal app, typed: ./mach eslint --setup - this seemed to work, it output this: Installing eslint... Installing eslint-plugin-mozilla... Installing esling-plugin-react... - then typed: ./mach eslint devtools/client/inspector This resulted in: ---------------------- Could not find eslint! We looked at the --binary option, at the ESLINT environment variable, and then at your path. Install eslint and needed plugins with mach eslint--setup and try again. ---------------------- However I did install eslint just before, using eslint --setup. Also note that I had eslint already installed on my Mac before.
Assignee: nobody → mratcliffe
This works fine for me... is it still an issue for you?
Flags: needinfo?(pbrosset)
Strangely it still is. `./mach eslint -s` appears to work, but once it's done, `./mach eslint some/file.js` doesn't work. It still complains that it couldn't find eslint.
Flags: needinfo?(pbrosset)
@pbrosset: You should have eslint installed at /usr/local/bin/eslint, can you confirm this? Also, can you confirm that `echo $PATH` includes /usr/local/bin? Typing eslint from the commandline should run eslint. I am really starting to wonder how much we can trust which.which.
Flags: needinfo?(pbrosset)
- So, if I *don't* have eslint installed and I type './mach eslint -s': Everything seems to go fine, the command runs until completion with no errors. But then running 'eslint' from the command line fails (unknown command). And running eslint as part of sublimeText (sublimeLinter) also fails (cannot locate eslint). - If I *do* install eslint globally on my system first with 'sudo npm install -g eslint': This installs eslint in '/usr/local/bin/eslint' Typing 'eslint' on the command line does work correctly obviously. 'echo $PATH' does contain '/usr/local/bin' However, eslint in sublimeLinter still doesn't work, even after I try './mach eslint -s'
Flags: needinfo?(pbrosset)
I am also experiencing this issue. I run './mach eslint --setup' and the command runs until completion with no errors [1] But when I try to commit something on gaia, I got this error [2]. Also no eslint was installed on /usr/local/bin/eslint and my $PATH does contain '/usr/local/bin'. [1] mozillas-MacBook-Pro:gecko-b2g-desktop anatal$ ./mach eslint --setup Installing eslint... Installing eslint-plugin-mozilla... Installing eslint-plugin-react... [2] mozillas-MacBook-Pro:gaia anatal$ git commit -a jshint check: 0 errors eslint check: module.js:338 throw err; ^ Error: Cannot find module 'eslint-plugin-mozilla' at Function.Module._resolveFilename (module.js:336:15)
(In reply to Patrick Brosset [:pbrosset] [:pbro] from comment #4) > - So, if I *don't* have eslint installed and I type './mach eslint -s': > Everything seems to go fine, the command runs until completion with no > errors. > But then running 'eslint' from the command line fails (unknown command). > And running eslint as part of sublimeText (sublimeLinter) also fails > (cannot locate eslint). > > - If I *do* install eslint globally on my system first with 'sudo npm > install -g eslint': > This installs eslint in '/usr/local/bin/eslint' > Typing 'eslint' on the command line does work correctly obviously. > 'echo $PATH' does contain '/usr/local/bin' > However, eslint in sublimeLinter still doesn't work, even after I try > './mach eslint -s' Can you make sure eslint is not installed locally with ./mach remove eslint? It should only be installed globally.
Can you try again with the latest version and report any errors?
I know this is working fine for pbrosset now.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.