microsoft / pxt-maker

MakeCode target for "Maker" boards (beta)
https://maker.makecode.com/
Other
120 stars 82 forks source link

Get local dev server working with modern node #379

Open campey opened 2 months ago

campey commented 2 months ago

Describe the bug Trying to follow the readme on various systems results in error messages.

To Reproduce Machine 1 Steps to reproduce the behavior on my macbook air:

  1. Go to 'https://github.com/microsoft/pxt-maker/'
  2. Follow Local Dev Server steps in readme.md
  3. Ignore lots of warnings and get to step 8
  4. See error
    ....
    npm error path /Users/campey/Code/microsoft/pxt-maker/node_modules/usb
    npm error command failed
    npm error command sh -c prebuild-install --runtime napi --verbose || node-gyp rebuild
    ...

    Notes Seems to be a cpp syntax/versioning issue with the older usb module, which is deprecated and we should probably replace anyway.

Node 16.20.2 "worked" enough to be able to pxt serve and see the page, then updating devDependencies to  "@types/node": "16.18.108" got it to the point where I could see the sim too!

To Reproduce Machine 2 Steps to reproduce the behavior on @max9403's Windows desktop:

  1. Go to 'https://github.com/microsoft/pxt-maker/'
  2. Follow Local Dev Server steps in readme.md
  3. Get to step pxt builddaldts
  4. See error
    ...
    error: sim/tsconfig.json expected compilerOptions.outFile:"../built/sim.js", got "undefined"

    Notes ... but it then serves on the MS machine.

Expected behavior Build should complete without error.

Desktop:

Laptop:

Additional context @max9403, @apead and I are going to be hacking away at this, just raising the issue for visibility & collaboration.

campey commented 2 months ago

removed webusb from package.json npm install worked this time!   And served.   Do we need webusb in pxt-maker? I can't find references in the codebase.