ipfs-examples/helia-examples

Error: Cannot find module '/Users/me/helia-examples/examples/helia-101/index.js'

kopeboy opened this issue · 2 comments

Steps to reproduce on macOS with node v20.5.0:

~/
gh repo clone ipfs-examples/helia-examples
cd helia-examples/examples/helia-101
npm install
npm start
=>

> helia-101@1.0.0 start
> node index.js

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

Error: Cannot find module '/Users/kopeboy/helia-examples/examples/helia-101/index.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901: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 v20.5.0
npm ERR! Lifecycle script `start` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: helia-101@1.0.0
npm ERR!   at location: /Users/kopeboy/helia-examples/examples/helia-101
pius commented

Seems like maybe someone forgot to modify the start script? I assume that it’s supposed to run “101-basics.js” instead of index.js, but I can’t confirm because that fails for me for unrelated reasons.

I see that you opened this in October … has someone replied to you about this privately, @kopeboy?

Seems like maybe someone forgot to modify the start script?

Exactly this! This will be fixed by #270 but in the interim you can just run the scripts directly with node 101-basics.js, node 201-storage.js etc.