Closed healthypets closed 8 years ago
Can you provide a link to your project on github? Or create a sample one if you don't have it. Thanks
https://github.com/healthypets/project-base
Wasn't sure if you wanted the node modules or not so I intentionally left them. Can do a clean install if necessary. ESLint in brackets throws a 'cannot find module eslint-config-angular' error when trying to lint inside of brackets for lint-test.js
So, your project is using eslint-config-angular
but the error message says this:
You can fix it by doing npm install --save eslint-plugin-angular
in your project. After that:
Hmm perhaps there is a difference in environment here then.
Mine is showing:
ESLint terminated with error: Error: Cannot find module 'eslint-config-angular' Referenced from: C:\xampp\htdocs\project-base\.eslintrc.js
I'm on Windows, though that's likely not the only env difference.
What version of Brackets are you running?
I recommend trying out latest 1.8 pre-release from here: https://github.com/adobe/brackets/releases or my electron build from here: https://github.com/zaggino/brackets-electron/releases
Brackets before 1.8 doesn't work with eslint version 3
Currently running Release 1.7 so that would make sense. I'll install that release. Apparently I missed that memo, thanks!
Let me know if the upgrade to 1.8 did work for you please.
Updated the to latest 1.8 pre-release from Brackets. Still getting the following:
ESLint terminated with error: Error: Cannot find module 'eslint-config-angular' Referenced from: C:\xampp\htdocs\project-base\.eslintrc.js
If I just have base rules in the .eslintrc.js then it seems to function fine. It just can't seem to find the module when I use: "extends": "angular"
When you open brackets console (Debug > Show developer tools or F12), do you have anything else there?
NodeDebugUtils.js:111 [node-error 2:47:18 PM] [brackets-eslint] Error thrown in executeOnText: Error: Cannot find module 'eslint-config-angular'
Referenced from: C:\xampp\htdocs\project-base\.eslintrc.js
at Object.ModuleResolver.resolve (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\util\module-resolver.js:75:19)
at resolve (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:479:33)
at load (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:496:24)
at C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:392:36
at Array.reduceRight (native)
at applyExtends (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:363:28)
at Object.load (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config\config-file.js:530:22)
at loadConfig (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config.js:64:33)
at getLocalConfig (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config.js:126:23)
at Config.getConfig (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\config.js:227:22)
at processText (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\cli-engine.js:223:27)
at CLIEngine.executeOnText (C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\node_modules\eslint\lib\cli-engine.js:761:26)
at C:\Users\User\AppData\Roaming\Brackets\extensions\user\brackets-eslint\dist\node\eslint.js:238:23
at fs.js:266:14
at C:\xampp\htdocs\project-base\node_modules\graceful-fs\graceful-fs.js:43:10
at C:\Program Files (x86)\Brackets\www\extensibility\node\node_modules\fs-extra\node_modules\rimraf\node_modules\graceful-fs\graceful-fs.js:103:5
I have now tried on second windows machine with your project and npm install eslint-plugin-angular
fixes it again. Can't help here. (I'm using brackets-electron for windows on both but that should not make a difference)
Okay, I will look at setting this up on a clean virtual machine. An acquaintance tried this as well and had the same issue not being able to find the config module. Perhaps a clean env will be different.
Thanks for your time!
I'd be interesting to find out what the problem is. If you wan't me to provide any settings, installed apps or whatever from my windows machines, let me know. But they are quite normal, latest versions of node, npm, git, etc.
Please also be sure to test this with https://github.com/zaggino/brackets-electron/releases too when you're at it, thanks!
I've also released brackets-eslint@3.0.0
which includes a fair bit of refactoring, maybe that'll help too.
Updated Brackets to 1.8 and now ESLint doesn't work at all. It worked just fine with 1.7, but now there's no coming back.
ESLintError: Legacy node process detected, please update to Brackets 1.8 or Brackets-Electron
Did you install Brackets 1.8 from here? https://github.com/adobe/brackets/releases
@guess-and-correct 3.0.2
will fix it but you need to use eslint
2.x in your project
@zaggino I did (the .msi
package).
For what it's worth, when updating ESLint using npm-registry, it threw a couple warnings about npm being too old. Even after updating Brackets to 1.8
, npm-registry is still using node v0.10.24
and npm 2.14.5
.
This is now fixed with latest Brackets (includes node v6)
Is it possible to get this working with eslint-config-angular?
I have been having issues with it not finding the module, even though I have tried both global and local installations.
Thanks!