繁体   English   中英

我无法安装 workbox cli

[英]I can't install workbox cli

我正在尝试使用工作箱 CLI 生成服务工作者。 我输入npm install workbox-cli --global

这是接下来发生的事情:

(c) Microsoft Corporation. All rights reserved.

C:\Users\turbn>npm install workbox-cli --global
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
c:\npm\workbox -> c:\npm\node_modules\workbox-cli\build\bin.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules\workbox-cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\workbox-cli\node_modules\rollup\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ workbox-cli@6.2.4
updated 1 package in 32.181s

C:\Users\turbn>workbox wizard
'workbox' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\turbn>```

> As you can see I tried to start the wizard, but it looks like workbox
> hasn't installed properly. I looked up fsevents but it seems to be
> something for mac. Have I tried to install workbox for mac? I don't
> have much experience with npm so I've probably just done something
> dumb.

目前尚不清楚您的npm配置可能存在什么问题。

我建议尝试运行workbox-cli而不使用npx全局安装它:

$ npx workbox-cli ...

作为备选。 这有望奏效(我认为现在全球安装软件包更可取)。

我在 linux 的 VS Code 中使用 PWABuilder Studio 时遇到了同样的问题。

我选择使用 sudo 在 VS Code 终端中运行命令:

$ sudo npm install workbox-cli --global

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM