ipfs-examples / helia-examples

How to do most anything with your Helia node
https://verified-fetch.vercel.app
72 stars 62 forks source link

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

Closed kopeboy closed 7 months ago

kopeboy commented 10 months ago

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 8 months ago

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?

achingbrain commented 7 months ago

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.