Skip to content
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

ESLint: Cannot find module 'functional-red-black-tree' (running in VS Code ESLint Extension) #516

Closed
David-Else opened this issue May 12, 2019 · 4 comments
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@David-Else
Copy link

As soon as I updated to 1.8.0 I got the following errors.

Repro

{
  "extends": [
    "./node_modules/eslint-config-airbnb-base/rules/best-practices.js",
    "./node_modules/eslint-config-airbnb-base/rules/errors.js",
    "./node_modules/eslint-config-airbnb-base/rules/node.js",
    "./node_modules/eslint-config-airbnb-base/rules/style.js",
    "./node_modules/eslint-config-airbnb-base/rules/variables.js",
    "./node_modules/eslint-config-airbnb-base/rules/es6.js",
    "plugin:@typescript-eslint/recommended",
    "prettier",
    "prettier/@typescript-eslint"
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "plugins": ["@typescript-eslint"],
  "rules": {
    "lines-between-class-members": "off",
    "no-use-before-define": "off",
    "@typescript-eslint/no-for-in-array": "warn",
    "@typescript-eslint/explicit-function-return-type": [
      "warn",
      {
        "allowExpressions": true
      }
    ]
  },
  "env": {
    "browser": true,
    "node": true,
    "mocha": true
  },
  "globals": {
    "assert": true
  }
}
// your repro code case

Expected Result

Actual Result

[Info  - 16:20:31] ESLint server stopped.
[Info  - 16:20:31] ESLint server running in node v10.2.0
[Info  - 16:20:31] ESLint server is running.
[Info  - 16:20:33] ESLint library loaded from: /home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/eslint/5.16.0/node_modules/eslint/lib/api.js
[Error - 16:20:34] ESLint stack trace:
[Error - 16:20:34] Error: Cannot find module 'functional-red-black-tree'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Function.Module._load (internal/modules/cjs/loader.js:528:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/@typescript-eslint/eslint-plugin/1.8.0/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js:8:53)
    at Object.<anonymous> (/home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/@typescript-eslint/eslint-plugin/1.8.0/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js:55:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
[Error - 16:20:34] ESLint stack trace:
[Error - 16:20:34] Error: Cannot find module 'functional-red-black-tree'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Function.Module._load (internal/modules/cjs/loader.js:528:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/@typescript-eslint/eslint-plugin/1.8.0/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js:8:53)
    at Object.<anonymous> (/home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/@typescript-eslint/eslint-plugin/1.8.0/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js:55:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
[Error - 16:20:34] ESLint stack trace:
[Error - 16:20:34] Error: Cannot find module 'functional-red-black-tree'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Function.Module._load (internal/modules/cjs/loader.js:528:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/@typescript-eslint/eslint-plugin/1.8.0/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js:8:53)
    at Object.<anonymous> (/home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/@typescript-eslint/eslint-plugin/1.8.0/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js:55:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)
[Error - 16:20:34] ESLint stack trace:
[Error - 16:20:34] Error: Cannot find module 'functional-red-black-tree'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:602:15)
    at Function.Module._load (internal/modules/cjs/loader.js:528:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/@typescript-eslint/eslint-plugin/1.8.0/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js:8:53)
    at Object.<anonymous> (/home/david/sites/typescript-is-fun-game-tutorial/node_modules/.registry.npmjs.org/@typescript-eslint/eslint-plugin/1.8.0/node_modules/@typescript-eslint/eslint-plugin/dist/rules/indent-new-do-not-use/BinarySearchTree.js:55:3)
    at Module._compile (internal/modules/cjs/loader.js:711:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:559:12)

Additional Info

**Versions**
    "@typescript-eslint/eslint-plugin": "1.8.0",
    "@typescript-eslint/parser": "1.8.0",
    "eslint": "^5.16.0",
@David-Else David-Else added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels May 12, 2019
@bradzacher
Copy link
Member

Ah, that would be because you're using eslint globally, correct?

@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for maintainers to take a look labels May 12, 2019
@David-Else
Copy link
Author

@bradzacher No, it is not installed globally, it is in the local project directory. If i type eslint on the command line I get bash: eslint: command not found...

I am using pnpm and it is giving me some funny errors in relation to global installs, could it be that, or should your fix sort things out?

Thanks for the quick response!

@bradzacher
Copy link
Member

It's probably pnpm. I forgot to add a dependency with a new experimental rule.
It should just work for everyone because it's also dependency for eslint itself, but things like yarn pnp will fail because it wasn't declared. I assume pnpm would fail in teh same way.

Try the canary tag on npm and it should work fine now!

@David-Else
Copy link
Author

I just installed 1.8.1-alpha.2 and it works again, cheers!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants