简体   繁体   English

npm 安装:反应脚本安装失败

[英]npm install: react-scripts install fails

I have the following (simplified) package.json file:我有以下(简化的)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"
  ]
}`

When I tried to install it with npm install it failed several times (first some warnings about deprecated dependencies, and at the end several npm ERR. codes (see below), I tried to delete the node_modules folder, tried npm cache clear --force , none of them helped. Here is the output of npm install:当我尝试使用npm install它时,安装它失败了几次(首先是一些关于不推荐使用的依赖项的警告,最后是几个 npm ERR.代码(见下文),我试图删除 node_modules 文件夹,尝试npm cache clear --force , 他们都没有帮助. 这是 npm 安装的 output :

$ npm install
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 fetching binaries from AWS, smaller package size
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated core-js@2.6.10: 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 ts-pnp@1.1.4 requires a peer of typescript@* 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@1.2.9 (node_modules\jest-haste-map\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: 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 home, 64bit Node: v13.1.0 npm: 6.12.1操作系统:Win10 家庭版,64 位节点:v13.1.0 npm:6.12.1

Any ideas what am I doing wrong?任何想法我做错了什么?

Thanks!谢谢!

So, it seems, that Dropbox synch was the guilty one, that locked something during npm install which npm didn't like.因此,Dropbox 同步似乎是有罪的,它在npm install期间锁定了 npm 不喜欢的东西。 I moved the folder outside from my dropbox folder, and... surprise, surprise... worked like charm.我将文件夹从我的保管箱文件夹中移出,然后......惊喜,惊喜......就像魅力一样。

Now the task is to find a solution to selectively exclude subfolders from synching (dropbox doesn't support a.gitignore-like solution), but this is nothing to do with javascript or node or npm...现在的任务是找到一种解决方案,从同步中选择性地排除子文件夹(dropbox 不支持类似.gitignore 的解决方案),但这与 javascript 或 node 或 npm 无关...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM