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.

Error: Failed to load plugin '@nrwl/nx' declared in '.eslintrc.json » ../../../.eslintrc.json#overrides[1]': The specified module could not be found.

See original GitHub issue

Current Behavior

Cannot lint projects & libs in webstorm

image

Expected Behavior

Should lint all projects & libs

Repo > main or steps to Reproduce

npx create-nx-workspace nx-workspace --style=scss --nx-cloud=false --preset=angular --cli=angular --pm=yarn --appName=web-client
nx affected:lint

Failure Logs

Error: Failed to load plugin '@nrwl/nx' declared in '.eslintrc.json » ../../../.eslintrc.json#overrides[1]': The specified module could not be found.
\\?\D:\dev\web\practice\workspace\node_modules\@swc\core-win32-x64-msvc\swc.win32-x64-msvc.node
Referenced from: D:\dev\web\practice\workspace\.eslintrc.json

Error: Failed to load plugin '@nrwl/nx' declared in '.eslintrc.json » ../../../.eslintrc.json#overrides[1]': The specified module could not be found.
\\?\D:\dev\web\practice\workspace\node_modules\@swc\core-win32-x64-msvc\swc.win32-x64-msvc.node
Referenced from: D:\dev\web\practice\workspace\.eslintrc.json
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1185:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\dev\web\practice\workspace\node_modules\@swc\core\binding.js:67:41)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)

Environment

   Node : 16.14.0
   OS   : win32 x64
   yarn : 1.22.17

   nx : 13.8.3
   @nrwl/angular : 13.8.3
   @nrwl/cli : 13.8.3
         @angular/animations: 13.2.3
         @angular/common: 13.2.3
         @angular/compiler: 13.2.3
         @angular/core: 13.2.3
         @angular/forms: 13.2.3
         @angular/platform-browser: 13.2.3
         @angular/platform-browser-dynamic: 13.2.3
         @angular/router: 13.2.3
         @angular-devkit/build-angular: 13.2.4
         @angular/cli: 13.2.4
         @angular/compiler-cli: 13.2.3
         @angular/language-service: 13.2.3

(node:13900) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at D:\dev\web\bugs\workspace\node_modules\tslib\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
mlefebvre-adeocommented, Feb 24, 2022

Resolved this issue with npm i -D @swc/core but couldn’t quickly find the culprit library

2reactions
meeroslavcommented, Mar 15, 2022

To all still stuck with this error.

Can you try updating to min v13.8.5? From this version on we explicitly depend on @swc/core which depends optionally on platform-specific implementations of the core.

Even previous versions should work as @swc-node/register depended on @swc/core indirectly, so there might be something else at stake.

You can try running this repo on your local or CI setup: https://github.com/meeroslav/linter-swc-test.

Dependencies, when installed with yarn --frozen-lockfile on MacOS will have appropriate core-darwin-arm64 installed: Screenshot 2022-03-15 at 14 23 29

When installed on Windows it will have core-win32-x64-msvc installed (depending on the os version): image

Most issues we’ve seen so far were the results of corrupted lock files. The following steps should solve those issues:

  1. remove lock file and node_modules
  2. (optionally) run npm cache clean --force or yarn cache clean
  3. re-installing the packages (npm install or yarn)

If not, please open another issue specifying your OS, node version, nx version, and package manager.

I will close this one, as OPs issue has been resolved by following steps above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Failed to load plugin declared in '.eslintrc' : WEB-44691
rc file to use 'eslint-plugin-fp'. Got the error: Error: Failed to load plugin 'fp' declared in '.eslintrc': Cannot find module 'eslint ...
Read more >
Using ESLint in Nx Workspaces
ESLint is powerful linter by itself, able to work on the syntax of your source files and assert things about based on the...
Read more >
[eslint] failed to load plugin 'prettier' declared in '.eslintrc.json'
I am getting the following error as I am trying to build with maven. [INFO] Error: Failed to load plugin '@typescript-eslint' declared in...
Read more >
Failed to load plugin 'import' declared in '... » eslint-config ...
I had the same issue for many weeks and finally found this thread and comment on Github: ...
Read more >
Failed to load plugin '@nrwl/nx': Cannot find module '@swc ...
Failed to load plugin '@nrwl/nx' declared in 'libs/eds-base/.eslintrc.json » . ... eslintrc.json#overrides[1]': Cannot find module '@swc/core-linux-x64-gnu' ...
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