zoukankan      html  css  js  c++  java
  • npm WARN deprecated fsevents windows

    更新下 使用yarn貌似会帮助跳过这个问题:

    info fsevents@2.1.2: The platform "win32" is incompatible with this module.
    info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
    info fsevents@1.2.9: The platform "win32" is incompatible with this module.
    info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.

    ===

    有需要下载了一个模板项目,安装ui部分失败,提示:

    npm WARN deprecated fsevents@1.2.9: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetch
    ing binaries from AWS, smaller package size
    npm ERR! Unexpected end of JSON input while parsing near '...LNCxGNsOAHRWRMGoXrtcI'

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:UsersuserAppDataRoaming pm-cache\_logs2019-12-06T07_31_31_687Z-debug.log

    单独提出来安装:

    $ npm install fsevents
    npm ERR! code EBADPLATFORM
    npm ERR! notsup Unsupported platform for fsevents@2.1.2: 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

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:Users eoliu6AppDataRoaming pm-cache\_logs2019-12-06T07_33_23_843Z-debug.log

    原因明了了,这个包是在mac系统中的,windows没有。查了下资料,大概是windows也不需要,不用安装。

    解决方法是,把fsevents依赖放到可选依赖中:

    vi package.json

      "optionalDependencies": {
        "fsevents": "*"
      }

    重新执行安装(有个坑,需要删除package_lock.json,否则标记会失效,所有依赖都将被安装):

    npm install --no-optional
    

    参考资料:

    https://stackoverflow.com/questions/41570364/npm-install-not-working-in-windows#

    But it says it is optional so I ran $npm install --no-optional and that error went away but I still can't install.

    https://github.com/npm/npm/issues/17633

    I'm seeing this today with npm 5.3.0. npm install --no-optional works IIF a package-lock.json does not exist. If the package-lock.json file exists, then the flag is ignored and all dependencies get installed.

     
     
     
  • 相关阅读:
    Linux文件管理
    网络层基础
    引导与服务控制实验
    交换机基础
    计算机网络基础
    计算机视觉 牛人主页 Hanson
    CV codes代码分类整理合集(http://www.sigvc.org/bbs/thread7211.html) Hanson
    机器学习中的相似性度量 (附matlab代码) Hanson
    机器学习问题方法总结 Hanson
    支持向量机很全的代码和数据集 Hanson
  • 原文地址:https://www.cnblogs.com/neoliu6/p/11995989.html
Copyright © 2011-2022 走看看