Get hyperdrive in a new project


#1

I’ve been experimenting with the Dat Project protocol. I created a new Glitch Node project, command-line-hyperdrive and used code from https://github.com/mafintosh/hyperdrive to create created a file, test-hyperdrive.js. I used the Add Package button on package.json to add hyperdrive which showed right up as:
“hyperdrive”: “^9.12.3”

However when I run
node test-hyperdrive.js
I get the error
Error: Cannot find module ‘hyperdrive’
(Detail below)

So I tried to:
pnpm install hyperdrive
and got:

app@command-line-hyperdrive:~ 15:07
$ pnpm install hyperdrive
A store server is running. All store manipulations are delegated to it.
WARN using --shamefully-flatten is discouraged, you should declare all of your dependencies in package.json
WARN waiting for another installation to complete…

Eventually the console window timed out. I still get the same error when I run node test-hyperdrive.js

However, when I remix codemirror-multicore and run the same test-hyperdrive.js in it it works fine.

Is there a way to make hyperdrive work in a new project?

(by the way, Glitch is amazing and wonderful as in, it fills me with wonder!)

app@command-line-hyperdrive:~ 15:05
$ node test-hyperdrive.js
module.js:549
throw err;
^
Error: Cannot find module ‘hyperdrive’
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (/app/test-hyperdrive.js:2:18)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
app@command-line-hyperdrive:~ 15:07

app@command-line-hyperdrive:~ 15:07
$ pnpm install hyperdrive
A store server is running. All store manipulations are delegated to it.
WARN using --shamefully-flatten is discouraged, you should declare all of your dependencies in package.json
WARN waiting for another installation to complete…


#2

What’s the name of your project?


#3

command-line-hyperdrive


#4

Today I redid the project as test-hyperdrive-mshook and it works!