我正在关注本教程(让 cloudflare 页面与动物 db 一起使用),但是当我进入“测试和部署 Worker”一章并尝试运行wrangler dev
(它将运行npm run build
,然后运行worktop build index.js
)时,我收到错误消息sh: worktop: command not found
.
我仔细检查了我是否正确执行了每个步骤,检查worktop
了目录中是否存在node_modules
(它是)并且还尝试worktop
全局安装(不起作用)。
我在这里想念什么?
运行的完整输出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