npm安装:react-scripts安装失败

问题描述 投票:-1回答:1

我有以下(简化的)package.json文件:

`{
  "name": "cotd",
  "version": "0.0.3",
  "private": true,
  "dependencies": {},
  "devDependencies": {
    "react-scripts": "3.2.0"
  },
  "scripts": {
    "dev": "react-scripts start",
    "start": "react-scripts start"
  },
  "browserslist": [
    ">0.2%",
    "not ie <= 11",
    "not op_mini all"
  ]
}`

[当我尝试使用npm install安装它时,它几次失败了(首先是有关已过时依赖项的警告,最后是几个npm ERR!代码(请参见下文)。我试图删除node_modules文件夹,尝试了npm cache clear --force,但都无济于事。这是npm install的输出:

$ npm install
npm WARN deprecated [email protected]: One of your dependencies needs to upgrade to fsevents v2: 1) Proper nodejs v10+ support 2) No more fetching binaries from AWS, smaller package size
npm WARN deprecated [email protected]: use String.prototype.padStart()
npm WARN deprecated [email protected]: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN [email protected] requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] 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: [email protected] (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code EBUSY
npm ERR! syscall rename
npm ERR! path D:\MyEverything\Dropbox\Learning\WesBos\react-for-beginners\catch-of-the-day\node_modules\async\package.json.541798468
npm ERR! dest D:\MyEverything\Dropbox\Learning\WesBos\react-for-beginners\catch-of-the-day\node_modules\async\package.json
npm ERR! errno -4082
npm ERR! EBUSY: resource busy or locked, rename 'D:\MyEverything\Dropbox\Learning\WesBos\react-for-beginners\catch-of-the-day\node_modules\async\package.json.541798468' -> 'D:\MyEverything\Dropbox\Learning\WesBos\react-for-beginners\catch-of-the-day\node_modules\async\package.json'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\andra\AppData\Roaming\npm-cache\_logs\2019-11-17T19_03_36_237Z-debug.log

OS:Win10家庭版,64位节点:v13.1.0npm:6.12.1

任何想法我在做什么错?

谢谢!

javascript reactjs npm-install react-scripts
1个回答
0
投票

因此,似乎Dropbox同步是有罪的,它在npm install期间锁定了npm不喜欢的东西。我将文件夹从我的保管箱文件夹移到了外面,然后……出乎意料,出乎意料……就像魅力一样。

现在的任务是找到一种解决方案,以选择性地从同步中排除子文件夹(dropbox不支持类似.gitignore的解决方案,但这与javascript或node或npm无关。

© www.soinside.com 2019 - 2024. All rights reserved.