question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module './utils/ast-utils'

See original GitHub issue

Versions:

  • prettier-eslint version: 9.0.0
  • node version: 10.17.0
  • npm (or yarn) version: yarn 1.19.1

Have you followed the debugging tips?

Yes

Relevant code or config

https://gist.github.com/selfagency/d09dddd361376e47d515a0f1483b03de

What I did:

I use prettier-eslint via Vetur in VS Code and it’s been working just fine up until today, when it started throwing the following error.

What happened:

[INFO - 8:33:35 AM] Loaded module 'prettier-eslint@undefined' from '/Users/daniel/code/ironmarch/web/node_modules/prettier-eslint/dist/index.js'.
[ERROR - 8:33:35 AM] Error
Cannot find module './utils/ast-utils'
Require stack:
- /Users/daniel/code/ironmarch/web/node_modules/eslint/lib/rules/arrow-spacing.js
- /Users/daniel/code/ironmarch/web/node_modules/eslint/lib/built-in-rules-index.js
- /Users/daniel/code/ironmarch/web/node_modules/eslint/lib/rules.js
- /Users/daniel/code/ironmarch/web/node_modules/eslint/lib/linter.js
- /Users/daniel/code/ironmarch/web/node_modules/eslint/lib/api.js
- /Users/daniel/code/ironmarch/web/node_modules/prettier-eslint/dist/utils.js
- /Users/daniel/code/ironmarch/web/node_modules/prettier-eslint/dist/index.js
- /Users/daniel/.vscode/extensions/esbenp.prettier-vscode-3.6.0/dist/extension.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-amd.js
- /Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-fork.js

Problem description:

Cannot find module ‘./utils/ast-utils’

Suggested solution:

¯\_(ツ)_/¯

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
xieww-ariescommented, Dec 2, 2020

I got the same issue, but i think mostly because the newest version of eslint.

Error: Cannot find module 'eslint/lib/rules/utils/ast-utils'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/xieww/Desktop/CRN/FlightCharterPlane/node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-unused-vars.js:24:21)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
5reactions
skubecommented, Jun 2, 2020

This didn’t fix my issue 😦 https://www.stephencharlesweiss.com/2019-10-14/eslint-prettier-vscode/

However, the following steps did seem to rectify the issue:

  1. rm -rf ./node_modules && yarn
  2. Add "prettier-eslint.eslintIntegration": true, to VSCode Settings file (ignore Unknown configuration setting warning)
  3. Reload VSCode window (⌘ R)
  4. Remove "prettier-eslint.eslintIntegration": true, that was just put in
  5. Try saving a file

¯\_(ツ)_/¯

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues - GitHub
Hi all, I'm getting the following error after installing prettier-vscode and trying to format a file. Cannot find module '../ast-utils' I ...
Read more >
eslint error from vue Error: Cannot find module 'eslint/lib/ast-utils'
In my case I got a similar Error: Cannot find module 'eslint/lib/rules/utils/ast-utils' and I needed to upgrade eslint - v5 to v7 worked...
Read more >
jsx-ast-utils - npm
Usage. This is a utility module to evaluate AST objects for JSX syntax. This can be super useful when writing linting rules for...
Read more >
Cannot find module 'eslint/lib/ast-utils'-Vue.js - appsloveworld
In my case I got a similar Error: Cannot find module 'eslint/lib/rules/utils/ast-utils' and I needed to upgrade eslint - v5 to v7 worked...
Read more >
JavaScript Utils Module Not Found - Codecademy Forums
npm install utils --save; npm cache clean -f; Deleting the node_modules folder, package.json, package-lock.json, and then running npm install.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found