Skip to content

Error: Your current platform "freebsd" and architecture "x64" combination is not yet supported by the native Rollup build #135

Closed

Description

@wynkenstein

Hi there,

after trying to install latest build (0.6.4) on FreeBSD i got the following error when running npm run build :

Error: Your current platform "freebsd" and architecture "x64" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.

The following platform-architecture combinations are supported:
android-arm
android-arm64
darwin-arm64
darwin-x64
linux-arm
linux-arm64
linux-arm64 (musl)
linux-riscv64
linux-x64
linux-x64 (musl)
win32-arm64
win32-ia32
win32-x64

my attempted solution was changing a part of the package.json at the overrides section to:

"overrides": { "spotify-web-api-node": { "superagent": "$superagent" }, "rollup": "npm:@rollup/wasm-node" }

but still no luck.
Now the error message for npm run build reads:

multi-scrobbler@0.6.4 build
APP_VERSION=$npm_package_version vite build

node:internal/modules/esm/resolve:844
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'rollup' imported from /usr/home/stuff/installs/multi-scrobbler/node_modules/vite/dist/node/cli.js
at packageResolve (node:internal/modules/esm/resolve:844:9)
at moduleResolve (node:internal/modules/esm/resolve:901:20)
at defaultResolve (node:internal/modules/esm/resolve:1121:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap. (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v20.10.0

Activity

  1. FoxxMD commented on Feb 2, 2024

    @FoxxMD
    Owner

    I'm guessing you got the override from this issue? Try removing the npm: prefix:

      "overrides": {
        "spotify-web-api-node": {
          "superagent": "$superagent"
        },
        "rollup": "@rollup/wasm-node"
      }
    
  2. wynkenstein commented on Feb 2, 2024

    @wynkenstein
    Author

    Thanks for replying. I already tried that, with the same result.

  3. FoxxMD commented on Feb 2, 2024

    @FoxxMD
    Owner

    Ah I think I may have given you the wrong structure for overrides there. We need to tell npm to override a depedency of vite, not rollup itself.

    First...try this one:

    {
      "overrides": {
        "spotify-web-api-node": {
          "superagent": "$superagent"
        },
        "vite": {
          "rollup": "@rollup/wasm-node"
        }
      }
    }
    

    If that doesn't work then try this:

    {
      "devDependencies": {
        "@rollup/wasm-node": "^4.9.6"
       // ...
      },
      "overrides": {
        "spotify-web-api-node": {
          "superagent": "$superagent"
        },
        "vite": {
          "rollup": "$@rollup/wasm-node"
        }
      }
    }

    In both cases try to do an update first: npm update && npm install

    If neither of those work you could also try using pnpm and the solution given in that issue. Maybe pnpm has additional functionality for overrides that npm does not.

    P.S. the reason this is breaking now is due to changing from CRA to Vite in the last release.

  4. wynkenstein commented on Feb 5, 2024

    @wynkenstein
    Author

    I tried all possible solutions (both with npm and pnpm) but it still doesn't work. The last error (trying the second solution with pnpm) reads:

    > multi-scrobbler@0.6.4 build /usr/home/stuff/installs/multi-scrobbler
    > APP_VERSION=$npm_package_version vite build
    
    /usr/home/stuff/installs/multi-scrobbler/node_modules/.pnpm/rollup@4.9.6/node_modules/rollup/dist/native.js:38
            throw new Error(
                  ^
    
    Error: Your current platform "freebsd" and architecture "x64" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.
    
    The following platform-architecture combinations are supported:
    android-arm
    android-arm64
    darwin-arm64
    darwin-x64
    linux-arm
    linux-arm64
    linux-arm64 (musl)
    linux-riscv64
    linux-x64
    linux-x64 (musl)
    win32-arm64
    win32-ia32
    win32-x64
    
    If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.
        at Object.<anonymous> (/usr/home/stuff/installs/multi-scrobbler/node_modules/.pnpm/rollup@4.9.6/node_modules/rollup/dist/native.js:38:8)
        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 cjsLoader (node:internal/modules/esm/translators:345:17)
        at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:294:7)
        at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
        at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    
    Node.js v20.10.0
    ELIFECYCLE  Command failed with exit code 1.
    
  5. FoxxMD commented on Feb 5, 2024

    @FoxxMD
    Owner

    Maybe this comment will help? The version of vite MS uses specifies rollup^4.2.0 so try specifying a higher version?

    "overrides": {
      "vite": {
        "rollup": "npm:@rollup/wasm-node@^4.9.6"
      }
    }

    EDIT: this seems to work for me! Using the above overrides and then npm update then shows that node_modules/rollup/package.json is @rollup/wasm-node

  6. wynkenstein commented on Feb 5, 2024

    @wynkenstein
    Author

    Nice find, thank you! I cleared everything and did a fresh install and build with npm, only adding the vite override with specific version and now it works.

    > multi-scrobbler@0.6.4 build
    > APP_VERSION=$npm_package_version vite build
    
    vite v5.0.12 building for production...
    

    There are some "Deprecation Warning" in the process like for example:

        src/client/components/player/trackInfo.scss 64:8  root stylesheet
    
    Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
    
    Recommendation: math.div($spacing, 2) or calc($spacing / 2)
    
    More info and automated migrator: https://sass-lang.com/d/slash-div
    

    but I guess it's fine for now.

  7. FoxxMD commented on Feb 5, 2024

    @FoxxMD
    Owner

    The deprecation warnings are normal and unrelated to rollup -- just some things i need to fix in the css being built. Glad its working! I'm going to try to get some more information on rollup/wasm-node to see if I can officially replace rollup with it or if it should only be a stopgap: rollup/rollup#5378

  8. juliusiqbal commented on Apr 1, 2024

    @juliusiqbal

    I had to use below code in package.json file and remove node_modules folder and run npm install.

    "overrides": {
        "vite": {
          "rollup": "npm:@rollup/wasm-node"
        }
      }

    I had to run below commands for dockerized app where npm i should run inside container.

    docker compose run reusebin-ui npm i && \
      docker compose down && \
      rm -rf node_modules && \
      docker compose up --build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions