首页 > 解决方案 > 切换到Linux后我的npm与package.json不兼容?

问题描述

我最近切换到流行音乐!我的 macbook pro 11,1 (2013) 上的 OS Linux 并尝试克隆到我的 github 存储库并安装 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 ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/danielvillegas/.npm/_logs/2021-05-25T01_48_00_584Z-debug.log

我确实将最新版本的 npm 安装到了当前的新系统上 $ npm --version // 6.14.8

所以似乎我能够通过删除 package-lock.json 然后重新安装来解决问题npm install。但是......有没有办法可以在未来避免这个问题?我不确定它的根源是什么。

标签: node.jsreactjslinuxnpm

解决方案


推荐阅读