【问题标题】:facing issues in npm install packages面临 npm 安装包中的问题
【发布时间】:2020-12-25 04:56:47
【问题描述】:

我正在安装一个 react-app,但遇到了一些问题。我试图通过删除/node-modules 并重新安装来修复它,但它仍然给我带来了一些问题。我是一个 ubuntu 用户。请帮我解决一下这个。这是错误日志

suraj@suraj-Inspiron-15-3567:~/Documents/memories_project/client$ npm install axios npm WARN react-file-base64@1.0.3 requires a peer of react@^15.0.2 but none is installed. You 
must install peer dependencies yourself.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 
(node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.2.1 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.2.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ axios@0.21.1
updated 1 package and audited 1841 packages in 17.99s

124 packages are looking for funding
run `npm fund` for details

found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details

【问题讨论】:

    标签: reactjs ubuntu npm react-redux npm-install


    【解决方案1】:

    对等依赖不再自动安装,所以必须自己安装 您可以按照以下步骤操作

    1. 删除“package-lock.json”文件
    2. 在终端中,转到包含您的项目的文件夹并输入npm install --save-dev typescript react
    3. 然后输入npm install

    或者在您的 JSON 包中添加带有所需版本的 devDependencies 中的打字稿,并按照上述相同的步骤,除了第 2 点

    "typescript": "^2.8.0"
     //same for react
    

    了解更多here

    据我所知,您的 package.json 文件似乎有问题。

    【讨论】:

    • 我遇到了同样的错误:npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for fsevents@2.2.1: 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
    猜你喜欢
    • 2022-06-30
    • 1970-01-01
    • 2016-03-13
    • 2021-12-23
    • 2012-08-06
    • 2017-11-05
    • 2022-01-21
    • 1970-01-01
    • 2016-03-09
    相关资源
    最近更新 更多