如何修复 fsevents@1.2.9: wanted {“ os”: “ darwin”,“ arch”: “ any”}(当前: {“ os”: “ win32”,“ arch”: “ x64”})

测试二进制 二进制没问题 回滚节点-pre-gyp@0.12.0失败(这可能是无害的) :

EPERM: 操作不允许,lstat‘ C: 用户 orca Yoon 文档 IonicProjects 启动程序宏观节点 _ 模块 fsevents node _ module’

Npm 通知创建了一个 lockfile 作为 package-lock. json 这份文件。

Npm 警告可选跳过可选依赖项: fsevents@1.2.9 (node _ module fsevents) :

可选依赖性: 不支持的平台 针对 fsevents@1.2.9: 通缉{“ os”: “ darwin”,“ arch”: “ any”}(当前: {“ os”: “ win32”,“ arch”: “ x64”})

在445.94 s 中添加了来自1050个贡献者的1105个包,并审核了53269个包 发现1个高严重性漏洞 运行 npm audit fix来修复它们,或者运行 npm audit来获取详细信息

179826 次浏览
  • First,

Run your command prompt or powershell as Administrator role. Then you'll get avoided with PERMISSION ERROR.

  • Second,

Ignore npm audit fix. It only suggests you to renovate all of your package.json dependencies up-to-date. You should preserve the settings clarified in package.json.

  • Third,

If you're working on ubuntu or OS X, you won't face this issue, I guess.


PS:

According to your reply, I'd like to think about the workaround.

  • Remove the local node_modules & package-lock.json
  • Clean npm cache by npm cache verify
  • Update the global npm by sudo npm i -g npm
  • Reinstall the local node_modules by npm i

Hope this might help.

This warning will appear if you added IOS as platform to your project and run npm i on Windows or Linux. As you can't build IOS packages on these systems anyway you can safely ignore this warning.

When seeing this kind of message on ionic or anywhere else, do run npm audit fix and see if you can successfully follow the given advice to resolve all "high severity vulnerability" issues and contribute the resulting updated dependencies back to the given codebase.

What's happening here is that a package called chokidar is being used to "watch" filesystem directories for "events" (like files being added). chokidar is a wrapper for Linux-, Windows-, and Mac-specific filesystem-watching packages, of which fsevents is the Mac variant. So, I am pretty sure anything that uses chokidar is going to have fsevents as an optional dependency, but as others have said, this WARN message can be safely ignored, as chokidar supports all common desktop architectures.

You have to add win64 on package.json file

For example

{"os":"darwin,linux","arch":"any"} will replace with

{"os":"darwin,linux,win32,win64","arch":"any"}

I found a solution, this is what I did:

Open your package-lock.json.

Find node_modules/fsevents, inside this there is something called "os", I had only this:

 "os": [
"darwin",
],

So my OS is windows 10 64 bits I just added my OS inside "os", the result is this:

 "os": [
"darwin",
"win32"
],

then save and is solved, after doing this I could install the package I was trying to install that I couldn't.

If like me, you got this issue because of using two different package managers at the same time (E.g. yarn and npm), you can simply remove the lockfile and rerun your package manager.

rm package-lock.json

The lockfile will be regenerated the next time you run your package manager. I got this error while trying to upgrade the packages with npm upgrade. After deleting the lockfile, upgrade proceeded smoothly and the lockfile was created correctly.

As I got into the issue just today I read the first solution but tried one thing first

Remove package-lock.json and node_modules dir first

Run these commands and it should work.

rm -rf node_modules package-lock.json
npm install

worked like a charm maybe it'll help someone else.

I had the same issue:

  1. Deleted package-lock.json
  2. npm install

viola, it worked for me

After opening the command prompt or PowerShell in the administrator mode, what helped me was following this answer here.

I ran the command: npm i --force and that seemed to fix the issue.

If you're seeing this error in a node Github workflow, you can update the runs-on value in node.js.yml to macos-latest and it will work. Worked for me anyways.