I'm following this tutorial (to get cloudflare pages working with fauna db), but when I get to the chapter "Testing and deploying the Worker" and try to run wrangler dev
(which will run npm run build
, which in turn runs worktop build index.js
) I get the error message sh: worktop: command not found
.
I have double checked that I have followed each step correctly, checked if worktop
was present in the node_modules
directory (it is) and also tried to install worktop
globally (didn't work).
What am I missing here?
Full output of running wrangler dev
:
$ wrangler dev
Running npm run build
> fauna-demo-workers@1.0.0 build /Users/me/dev/fauna-demo-workers
> worktop build index.js
sh: worktop: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fauna-demo-workers@1.0.0 build: `worktop build index.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fauna-demo-workers@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2022-01-09T12_54_24_718Z-debug.log
Error: Build failed! Status Code: 1