-
-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find module '../ast-utils' when formating #672
Comments
Hi, { |
I just got the same issue |
I think it's related to |
The error doesn't provide much context, so I did Switching my project to depend on the same eslint as prettier-eslint (specifically, ^4.0.0) solved the problem for me. |
had the same issue, @swansontec was right, had two eslints in my node_modules
|
Is there any resolution for this? Encountering this on eslint 5.16.0 |
Looks like I have the same problem. Re-installing node_modules with yarn didn't do it for me. I'm using eslint 6.0. I am using |
I think this is down to: warning " > [email protected]" has incorrect peer dependency "[email protected] - 5.x". Reverting to |
@nfantone If I go back to 5.16.x I get errors like:
|
Same problem here with
Error:
|
@CiGit this is urgent now with the new eslint 6 released. |
this error happens in windows, in my mac, is fine |
import-js/eslint-plugin-import#1393 is merged and release but still the same problem. This is urgent. I'm crying... |
Your answer worksMy Eslint version is 6.0.1 . It got wrong in vscode . When I install Eslint 4.0.0 , everything was OK. |
@0x80 I honestly wouldn't know. You seem to be working with TS - I'm not. Most probably one of the plugins you're using do require |
@shaodahong Not actually true, I'm afraid. It fails on macOS as well. AFAIK, this is tied to supporting latest |
@nfantone sounds bad, hope there fix it |
Just ran into this as well so I assume this is about to really hit the fan if not updated soon since I just went through updating eslint across our repos. Luckily google gets here as the top result so it wasn't a time consuming thing to troubleshoot. Note that with the issue that @0x80 ran into you simply need to reload the VSCode Window ( |
None of the mentioned solutions do the trick for me. With With |
I've managed to get this working again with latest "eslint": "^6.0.1"
"eslint-config-prettier": "^6.0.0"
"eslint-plugin-import": "^2.18.0"
"eslint-plugin-node": "^9.1.0"
"eslint-plugin-prettier": "^3.1.0"
"eslint-plugin-promise": "^4.2.1"
"prettier": "^1.18.2" |
I am not using {
"eslint": "^6.0.1",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-prettier": "^3.1.0",
} Still doesn't work.
Setting |
@samrith-s That looks like an entirely different error to me: Sorry for the brainless question, but are you sure it's declared and installed on |
@samrith-s Apart from the obvious stuff (try removing the lockfile,
|
@nfantone I've upgraded all my dependencies to latest, removed node_modules and yarn.lock and reinstalled + restarted vscode. Still the same ast-utils error for me. This is with versions:
|
@nfantone I’ve tried all the possible solutions out there. The only thing that works is disabling |
@dijam @adriangrahl Is VSCode called MSCode now? Did I miss the memo? |
I'm still getting this issue despite following @dijam comment. my versions and settings are below: System: Project Package.json: VSCode setting: |
Downgrade eslint to previous working version not helped. I'm getting this issue. |
I did a global uninstall and a local uninstall then reinstalled everything locally and now things are working.
|
for vscode how to handle ? |
delete eslint Getting better |
At the current, my working solution is disable ESlint Integration setting in vscode while waiting for new update version. [1] Turn off ESlint Integration setting in vscode [2] Install eslint, eslint-config-google (I'm using config from Google)
The newest version will be:
[3] Configure eslint and prettier to make it work as expected
{
"extends": ["google"],
"parserOptions": {
"ecmaVersion": 2017
},
"rules": {
"object-curly-spacing": ["error", "always"],
"max-len": ["error", 80],
"indent": [2, 2, {"SwitchCase": 1}]
}
}
{
"semi": true,
"trailingComma": "es5",
"singleQuote": true,
"printWidth": 80,
"arrowParens": "always"
} With this configuration, I got the result as expected before getting error 😄 😄 😄 |
on And it works for me if I delete all modules about eslint and reinstall them |
This issue isn't the real issue, this is just a consequence. |
eslint: eslint+prettier: |
Duplicate of #870 |
downgrade 5.4.0 . it works !!! |
please help |
Downgrading to 5.4.0 helped made it work. After that doing a couple of upgrades: to 5.14.0, 5.15.3 and eventually to 5.16.0 all started to work again for some reason \o/ Thank you @Mr-SPM for this tip. Before that I tried to remove all eslint dependencies and reinstall them, it didn't work. Tried the |
Upgrading eslint from |
Neither ESLint |
Just so it shows back up at the bottom of the thread: pinning to eslint version
|
ESLint is failing in windows for some reason. This version seems to work. @see prettier/prettier-vscode#672
This comment has been minimized.
This comment has been minimized.
Seems "prettier.eslintIntegration" config is now deprecated. there are a deprecation notice and solution in the readme: https://github.com/prettier/prettier-vscode#vscode-eslint-and-tslint-integration |
Thanks @mort3za . For the lazy:
|
I had the same weird problem. I use eslint with eslint-plugin-prettier together. Somehow this was colliding with VSCode prettier plugin. After i disabled VSCode prettier plugin and using only eslint it was working again. Also had to set "eslint.autoFixOnSave" to true. |
For some reason removing the vs code prettier plugin worked for me |
If you are using ESLint to do formatting, another option instead of disabling the plugin would be to disable prettier from formatting the languages you want to be handled by ESLint. You can do this with the by adding a
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi all,
I'm getting the following error after installing prettier-vscode and trying to format a file.
Cannot find module '../ast-utils'
I have no idea about what's happening.
The text was updated successfully, but these errors were encountered: