create-react-app Windows 10 Powershell中创建react应用时,yarn.lock文件出现EPERM错误,

k4aesqcs  于 2个月前  发布在  React
关注(0)|答案(3)|浏览(28)

在使用Windows PowerShell运行命令 'npx create-react-app xx' 时,我遇到了一个错误:"EPERM: operation not permitted, open 'C:\Users\brice\sourcerepos\xx\yarn.lock'"。即使提升到管理员权限,我也会遇到这个错误。我在source\repos文件夹上拥有完全的权限。

环境

环境信息:
create-react-app的当前版本:4.0.3
从 C:\Users\brice\AppData\Local
pm-cache_npx\c67e74de0542c87c
ode_modules\create-react-app运行
系统:
操作系统:Windows 10 10.0.19042
CPU:(12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
二进制文件:
Node: 16.13.0 - C:\Program Files
odejs
ode.EXE
Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 8.1.3 - C:\Program Files
odejs
pm.CMD
浏览器:
Chrome: 95.0.4638.69
Edge: Spartan (44.19041.1266.0), Chromium (95.0.1020.44)
Internet Explorer: 11.0.19041.1202
npmPackages:
react: Not Found
react-dom: Not Found
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found

qlvxas9a

qlvxas9a1#

你试过在procmon中复现这个问题吗?当我遇到类似这样的奇怪问题时,通常我会从这里开始。

cl25kdpy

cl25kdpy2#

这个问题已经被自动标记为过时,因为它没有任何最近的活动。如果没有发生任何进一步的活动,它将在5天后被关闭。

q3aa0525

q3aa05253#

我遇到了相同的问题:

正在安装软件包。这可能需要几分钟。
使用cra-template安装react, react-dom和react-scripts...
yarn add v1.22.15
 info 没有找到锁文件。
 [1/4] 解析软件包...
警告 react-scripts > @svgr/webpack > @svgr/plugin-svgo > svgo@1.3.2:此SVGO版本已不再受支持。升级到v2.x.x。
 [2/4] 获取软件包...
错误 发生了意外的错误:"C:\Users\xxx\AppData\Local\Yarn\Cache\v6\ [npm-@babel-plugin-transform-for-of-7.16.7-649d639d4617dff502a9a158c479b3b556728d8c-integrity](mailto:npm-@babel-plugin-transform-for-of-7.16.7-649d639d4617dff502a9a158c479b3b556728d8c-integrity) 
ode_modules\@babel\plugin-transform-for-of\.yarn-metadata.json:JSON输入意外结束"。
信息 如果你认为这是一个bug,请使用提供的信息在"C:\Users\xxx\Desktop\xxx\yarn-error.log"中打开一个错误报告。
信息 访问***[https://yarnpkg.com/en/docs/cli/add](https://yarnpkg.com/en/docs/cli/add)***以了解有关此命令的文档。
中止安装。

相关问题