node.js - 切换到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
。但是......有没有办法可以在未来避免这个问题?我不确定它的根源是什么。
解决方案
推荐阅读
- laravel-5 - UTF8 显示数据的问题(奇怪的字符)
- regular-language - 强化学习当量比
- makefile - 如何定义生成文件条件并在多个构建规则中重用它?
- javascript - 如何从下拉列表中显示内容(选项)
- botframework - 有没有办法将 v4 机器人添加到 Teams?
- vue.js - 从子组件调用父函数的父函数
- python - ret 中的 ret 是什么,track_window=cv2.CamShift()
- sql - SQL,使用列号而不是列名
- events - 如何在 Splunk 中构建按时间顺序排列的事件列表
- react-native - index.js:找不到模块'.../@react-native-community/cli/node_modules/metro-react-native-babel-transformation/src/index.js'(空))