部署到 Azure 时,npm 错误 fsEvents 平台不受支持

新手上路,请多包涵

当我运行 npm install 时,我收到此错误:

 npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for
fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current:
{"os":"win32","arch":"x64"}) npm ERR! notsup Valid OS:    darwin npm
ERR! notsup Valid Arch:  any npm ERR! notsup Actual OS:   win32 npm
ERR! notsup Actual Arch: x64

此处已提出 问题,但已接受的可选答案对我不起作用,因为由于 npm install 失败,我无法发布到 azure。

npm 版本: 5.6.0

我努力了:

 npm install --no-optional

原文由 Curious-programmer 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 618
1 个回答

npm i -f 听起来不是个好主意……

相反,将 fsevents 添加到可选依赖项(如果 fsevents 在您的 package.json 中):

 "optionalDependencies": {
    "fsevents": "^2.0.7"
}

原文由 Benjamin Piette 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题