bmatcuk / eslint-plugin-postcss-modules

Checks that you are using the classes exported by your css modules using postcss.
MIT License
21 stars 7 forks source link

Error: Failed to load plugin 'postcss-modules' declared in '.eslintrc.js': Could not locate the bindings file. Tried: #40

Open dhffdh opened 8 months ago

dhffdh commented 8 months ago

VSCode output of eslint plugin:

Error: Failed to load plugin 'postcss-modules' declared in '.eslintrc.js': Could not locate the bindings file. Tried:
 → /node_modules/deasync/build/deasync.node
 → /node_modules/deasync/build/Debug/deasync.node
 → /node_modules/deasync/build/Release/deasync.node
 → /node_modules/deasync/out/Debug/deasync.node
 → /node_modules/deasync/Debug/deasync.node
 → /node_modules/deasync/out/Release/deasync.node
 → /node_modules/deasync/Release/deasync.node
 → /node_modules/deasync/build/default/deasync.node
 → /node_modules/deasync/compiled/18.15.0/darwin/arm64/deasync.node
 → /node_modules/deasync/addon-build/release/install-root/deasync.node
 → /node_modules/deasync/addon-build/debug/install-root/deasync.node
 → /node_modules/deasync/addon-build/default/install-root/deasync.node
 → /node_modules/deasync/lib/binding/node-v116-darwin-arm64/deasync.node
Referenced from: /.eslintrc.js
    at bindings (/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/node_modules/deasync/index.js:30:31)
    at Module._compile (node:internal/modules/cjs/loader:1316:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1371:10)
    at Module.load (node:internal/modules/cjs/loader:1171:32)
    at Module._load (node:internal/modules/cjs/loader:1012:12)
    at f._load (node:electron/js2c/asar_bundle:2:13377)
    at Module.require (node:internal/modules/cjs/loader:1195:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (/node_modules/eslint-plugin-postcss-modules/dist/sync.js:3:19)

environment:

Not helped:

bmatcuk commented 8 months ago

The error "Could not locate the bindings file" seems to indicate some problem with your local node modules. If you google that error message, you'll find a ton of people asking about it, for example, this stackoverflow post.

Solution seems to be to remove your node_modules directory and reinstall, or npm rebuild.

surdu commented 7 months ago

I've removed the node_modules folder and reinstalled everything, but having the same issue.

I suspect the issue is with the Apple M2 Pro chip. I had a lot of problem with packages that have some pre-compiled binaries, that usually don't contain also the binaries for the ARM architecture that the M2 is using.

Looking at the deasync lib, I see that is written in C++, so I'm guessing that they don't include binaries for ARM.

I'm seeing there is an issue opened there for the same issue.

dhffdh commented 7 months ago

Solution seems to be to remove your node_modules directory and reinstall, or npm rebuild.

I've already tried it. It doesn't help

dhffdh commented 7 months ago

Looking at the deasync lib, I see that is written in C++, so I'm guessing that they don't include binaries for ARM.

Try cp node_modules/deasync/bin/darwin-arm64-node-20/deasync.node node_modules/deasync/build/deasync.node It helped me