microsoft / pxt-mkc

Command line tool for MakeCode editors
https://microsoft.github.io/pxt-mkc/
MIT License
13 stars 6 forks source link

makecode failing (microcode build) #97

Open tballmsft opened 1 year ago

tballmsft commented 1 year ago
Run makecode --java-script
node:internal/modules/cjs/loader:998
  throw err;
  ^

Error: Cannot find module '../../makecode-core/built/commands'
Require stack:
- /opt/hostedtoolcache/node/16.19.0/x6[4](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:5)/lib/node_modules/makecode/built/cli.js
- /opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/makecode/makecode
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:99[5](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:6):15)
    at Function.Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:10[6](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:7)[7](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:8):19)
    at require (node:internal/modules/cjs/helpers:103:1[8](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:9))
    at Object.<anonymous> (/opt/hostedtoolcache/node/16.1[9](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:10).0/x64/lib/node_modules/makecode/built/cli.js:16:20)
    at Module._compile (node:internal/modules/cjs/loader:1165:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:[10](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:11))
    at Module.load (node:internal/modules/cjs/loader:1043:32)
    at Function.Module._load (node:internal/modules/cjs/loader:878:[12](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:13))
    at Module.require (node:internal/modules/cjs/loader:1067:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/hostedtoolcache/node/[16](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:17).[19](https://github.com/microsoft/microcode/actions/runs/4180400738/jobs/7241342595#step:6:20).0/x64/lib/node_modules/makecode/built/cli.js',
    '/opt/hostedtoolcache/node/16.19.0/x64/lib/node_modules/makecode/makecode'
  ]
}
Error: Process completed with exit code 1.
tballmsft commented 1 year ago

Still failing. See following script (after uninstalling makecode):

$ npm install -g makecode

changed 24 packages in 771ms

3 packages are looking for funding
  run `npm fund` for details

tball@oldsurface MINGW64 /c/github/microcode (main)
$ mkc --version
node:internal/modules/cjs/loader:1050
  throw err;
  ^

Error: Cannot find module '../../makecode-core/built/commands'
Require stack:
- C:\Users\tball\AppData\Roaming\npm\node_modules\makecode\built\cli.js
- C:\Users\tball\AppData\Roaming\npm\node_modules\makecode\makecode
←[90m    at Module._resolveFilename (node:internal/modules/cjs/loader:1047:15)←[39m
←[90m    at Module._load (node:internal/modules/cjs/loader:893:27)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:1113:19)←[39m
←[90m    at require (node:internal/modules/cjs/helpers:103:18)←[39m
    at Object.<anonymous> (C:\Users\tball\AppData\Roaming\npm\node_modules\←[4mmakecode←[24m\built\cli.js:7:20)
←[90m    at Module._compile (node:internal/modules/cjs/loader:1226:14)←[39m
←[90m    at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:1089:32)←[39m
←[90m    at Module._load (node:internal/modules/cjs/loader:930:12)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:1113:19)←[39m {
  code: ←[32m'MODULE_NOT_FOUND'←[39m,
  requireStack: [
    ←[32m'C:\\Users\\tball\\AppData\\Roaming\\npm\\node_modules\\makecode\\built\\cli.js'←[39m,
    ←[32m'C:\\Users\\tball\\AppData\\Roaming\\npm\\node_modules\\makecode\\makecode'←[39m
  ]
}

Node.js v18.14.0
jwunderl commented 1 year ago

Hm could you run npm list -g makecode real quick and see what it shows? I tried what you had and it seemed to work on my end

$ npm install -g makecode
added 24 packages, and audited 26 packages in 1s

found 0 vulnerabilities

$ mkc --version
1.1.0

$ npm list -g makecode
C:\Program Files\nodejs -> .\
└── makecode@1.1.0
xmeow commented 1 year ago

Same here, resolved by add global makecode-core

npm install -g makecode-core
pelikhan commented 1 year ago

Try npm install -g makecode@latest