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

Issue using mops with a mac M chip #199

Open
danboyce92 opened this issue Jan 19, 2024 · 4 comments
Open

Issue using mops with a mac M chip #199

danboyce92 opened this issue Jan 19, 2024 · 4 comments
Assignees
Labels
bug Something isn't working cli

Comments

@danboyce92
Copy link

Apologies if this is the wrong place for this,
I'm having trouble getting mops to work at all. Since I installed it, I can't get my canisters to deploy.
The error mentions something about a missing module darwin-x64, is this because I'm using an M chip with mac?
I've followed install instructions closely, even uninstalled everything and tried again same error.
Is there a work around for this?

Here is my dfx.json

{
    "canisters": {
        "main_canister": {
            "main": "src/Main.mo",
            "type": "motoko"
        },
        "game_canister": {
            "main": "src/Game.mo",
            "type": "motoko"
        }
    },
    "defaults": {
        "build": {
            "args": "",
            "packtool": "mops sources"
        }
    }
}

and here is the error :

Caused by: Failed while trying to deploy canisters.
Failed to build all canisters.
Failed while trying to build all canisters.
The build step failed for canister 'bd3sg-teaaa-aaaaa-qaaba-cai' (main_canister) with an embedded error: Failed to build Motoko canister 'main_canister'.: Failed to load package arguments.: The command '"mops" "sources"' failed with exit status 'exit status: 1'.
Stdout:

Stderr:
node:internal/modules/cjs/loader:1144
const err = new Error(message);
^

Error: Cannot find module '@napi-rs/lzma-darwin-x64'
Require stack:

  • /usr/local/lib/node_modules/ic-mops/node_modules/@napi-rs/lzma/index.js
  • /usr/local/lib/node_modules/ic-mops/node_modules/@napi-rs/lzma/xz.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1144:15)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object. (/usr/local/lib/node_modules/ic-mops/node_modules/@napi-rs/lzma/index.js:1:2289)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/usr/local/lib/node_modules/ic-mops/node_modules/@napi-rs/lzma/index.js',
    '/usr/local/lib/node_modules/ic-mops/node_modules/@napi-rs/lzma/xz.js'
    ]
    }
@tommygames
Copy link

Two devs on our team are also getting this same exact issue, both of them are using macbooks with M chips. It just started happening recently. We're blocked from being able to deploy canisters because of it.

@ZenVoich
Copy link
Owner

Thank you for bug report.
I suppose this started after updating mops cli?

The problem with dependencies of decomp-tarxz package that required to unzip wasmtime xz archive.
I just published mops 0.38.2 with temp fix, now decomp-tarxz is imported only when you download wasmtime binary. I hope this will fix it for you now. Just update mops cli npm i -g ic-mops

If you have problems with mops toolchain and wasmtime, I can propose these steps(I didn't check):

npm uninstall -g ic-mops
npm install -g --arch=x64 --platform=darwin ic-mops

If this didn't work, please post here and I will look for another solution.

@ZenVoich ZenVoich self-assigned this Jan 20, 2024
@ZenVoich ZenVoich added bug Something isn't working cli labels Jan 20, 2024
@baolongt
Copy link

baolongt commented Jun 6, 2024

Same problem in ubuntu WSL

 Error: Cannot find module '@napi-rs/lzma-linux-x64-gnu'
    Require stack:

@baolongt
Copy link

baolongt commented Jun 6, 2024

My WSL have npm and pnpm , I removed the npm global and installed ic-mops in pnpm and it work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cli
Projects
None yet
Development

No branches or pull requests

4 participants