运行wrapper dev时出现Cloudflare页面工作程序错误



我正在学习本教程(让cloudflare页面与动物数据库一起工作(,但当我进入章节";测试和部署工人";并尝试运行wrangler dev(它将运行npm run build,它又运行worktop build index.js(,我得到错误消息sh: worktop: command not found

我仔细检查了我是否正确执行了每个步骤,检查了node_modules目录中是否存在worktop(确实存在(,并尝试全局安装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

您必须安装worktop.build软件包。这就是worktop二进制文件的来源。名为"worktop"的包只是一个运行库。并不是每个人都想使用其固执己见的CLI/builder,因此需要单独的软件包。

(我是worktop&worktop.build的作者(

相关内容

最新更新