当我运行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
Run Code Online (Sandbox Code Playgroud)
这里已经被问到了,但是接受的答案是它是可选的并不适合我,因为我无法发布到azure,因为npm安装失败.
npm版本: 5.6.0
我试过了:
npm install --no-optional
Run Code Online (Sandbox Code Playgroud)
Ben*_*tte 12
npm i -f 听起来不是个好主意...
相反,将 fsevents 添加到可选依赖项(如果 fsevents 在您的 package.json 中):
"optionalDependencies": {
"fsevents": "^2.0.7"
}
Run Code Online (Sandbox Code Playgroud)
Oli*_*ver 10
@Aaron 是正确的。当我从 maven-frontend-plugin 中运行 npm install 时,这失败了。
我使用命令解决了这个问题npm i -f
(强制安装 npm)
仅当您在 Mac 上构建时才需要 fsevents。如果您要部署到 ubuntu、windows 等,则不需要。
请参阅此处npm package.json 操作系统特定依赖项,内容如下:
npm package.json 支持 os key,
还有可选的依赖项
os 可用于指定模块可以安装在哪个操作系统上。可选依赖项是模块依赖项,如果无法安装,npm 会跳过它们并继续安装。
任何一个都会起作用。我更喜欢将以下内容添加到我的 package.json 的根对象中:
"optionalDependencies": {
"fsevents": "^2.1.2",
},
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9189 次 |
| 最近记录: |