fsevents@1.2.13: wanted {“os“:“darwin“,“arch“:“any“} (current: {“os“:“win32“,“arch“:“x64“})

修复npm安装错误:不兼容平台与EBADPLATFORM问题
这篇博客介绍了在Windows系统中遇到npm安装fsevents包时出现的错误,包括npm警告提示关于lockfileVersion的不匹配以及fsevents包对特定操作系统的不支持。解决方案是在命令行添加`--force`参数强制安装,如`npm install less-loader --force`。这种方法可以解决因平台不兼容导致的npm安装失败问题。

报错解决方法:在安装依赖的时候

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents@1.2.13: 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

在命令后面加上 --force 重新运行

比如:npm i less less-loader -D --force 就OK了

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值