canvasxyz / canvas

Programmable runtime for peer-to-peer applications
https://canvas.xyz
70 stars 5 forks source link

cannot initialize a new project using canvas init #274

Open GGAlanSmithee opened 4 months ago

GGAlanSmithee commented 4 months ago

attempting to initialize a new project using the cli, I get the error below. I tried to install @canvas-js/okra-node individually, but does not change anything.

win 10, nodejs 20

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

Error: Cannot find module '../build/x64-win32/okra.node'
Require stack:
- {userfolder}\AppData\Roaming\nvm\v20.12.2\node_modules\@canvas-js\cli\node_modules\@canvas-js\okra-node\lib\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
    at Module._load (node:internal/modules/cjs/loader:984:27)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:179:18)
    at file:///{userfolder}/AppData/Roaming/nvm/v20.12.2/node_modules/@canvas-js/cli/node_modules/@canvas-js/okra-node/lib/index.js:11:14
    at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '{userfolder}\\AppData\\Roaming\\nvm\\v20.12.2\\node_modules\\@canvas-js\\cli\\node_modules\\@canvas-js\\okra-node\\lib\\index.js'
  ]
}

Node.js v20.12.2
GGAlanSmithee commented 4 months ago

As a follow up to this, I attempted to clone this repo, run npm i in the root, followed by running npm i in /examples/chat and finally npm run dev which resulted in

X [ERROR] Failed to resolve entry for package "@canvas-js/hooks". The package may have incorrect main/module/exports specified in its package.json. [plugin vite:dep-scan]

would love to be able to try this amazing package out, thankful for any help

GGAlanSmithee commented 4 months ago

This works out of the box using WSL