Skip to content

build fail from source code (windows) #331

Description

@yananlemon

I am new to node and grid-apps, I try to build it from source code,env is as below:

  1. windows 10
  2. grid-apps-4.0.33
  3. node version: v12.22.12,v13.14.0,v19.9.0,v22.13.1.

But when I execute npm install, they all fail with the following error message:

`grid-apps@4.0.31 preinstall

node bin/install-pre.js; npx webpack --config bin/webpack-three.js

node:internal/modules/cjs/loader:1093
throw err;
^

Error: Cannot find module 'E:\other-code\grid-apps-4.0.33\bin\install-pre.js;'
at Module._resolveFilename (node:internal/modules/cjs/loader:1090:15)
at Module._load (node:internal/modules/cjs/loader:934:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Node.js v19.9.0
npm error code 1
npm error path E:\other-code\grid-apps-4.0.33
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c node bin/install-pre.js; npx webpack --config bin/webpack-three.js
npm error A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache_logs\2025-02-08T01_49_21_138Z-debug-0.log
`

Any idea? Thanks.

Activity

  1. stewartoallen commented on Feb 8, 2025

    @stewartoallen
    Contributor

    I'm still trying to get the build to work on windows. it's a host of problems including script interpretation and sym link support (or lack thereof). I'm currently building the .exe's using electron builder on mac. wish I had a better answer.

  2. stewartoallen commented on Feb 8, 2025

    @stewartoallen
    Contributor

    I was able to get KM running from source on Windows by installing WSL Ubuntu, cloning the repo there. I used nvm to install / manage node versions, but you have other options for getting node into WSL. the Electron app will not build in WSL 1 because it requires all of the gui / x / whatever libraries, which are missing in WSL. but you can start KM in dev or prod mode with:

    git checkout rel-4.1
    npm run setup
    npm run dev --or-- npm run prod
    

    the Bambu integration code only runs in dev mode

    It's possible the Electron app will run for you if you have WSL 2. I'm only able to run WSL 1 in my environment. To attempt to run the Electron app, after npm run setup, use the command:

    npm run start
    
  3. changed the title [-]build fail from source code[/-] [+]build fail from source code (windows)[/+] on Mar 1, 2025
  4. stewartoallen commented on Mar 2, 2025

    @stewartoallen
    Contributor

    this is how I got builds to work under windows using PowerShell:

    this command allows npm to run once it's installed:

    Set-ExecutionPolicy Unrestricted -Scope CurrentUser
    

    install git:

    winget install --id Git.Git -e --source winget
    

    install node / npm:

    winget install Schniz.fnm
    

    open new power shell to continue install:

    fnm install 22
    fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression
    node -v # Should print "v22.14.0".
    npm -v # Should print "10.9.2".
    

    clone grid-apps repo:

    git clone https://github.com/gridspace/grid-apps
    

    build KM binary

    npm run setup
    npm run build-win
    

    .exe will be deposited in the dist directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions