mac-vscode保存 “App.js“失败: 权限不足。选择 “以超级用户身份重试“ 以超级用户身份重试。

当使用sudo创建create-react-app项目后,可能会遇到在vscode中无法修改和保存文件的问题。解决方法是通过访达找到项目文件夹,右键显示简介,添加当前用户到访问权限列表,并设置为读与写权限,确保权限修改应用到所有子文件和文件夹。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在这里插入图片描述

出现如图所示报错,一般原因是create-react-app创建项目时使用的是sudo管理员权限。

导致用vscode打开该项目文件夹之后无法对项目文件夹进行修改和保存,没有权限。

解决方法:

  1. 打开访达找到项目文件夹,右键文件夹 => 显示简介 (也可以用快捷键⌘ + ℹ️)。
    在这里插入图片描述
    在这里插入图片描述
  2. 添加自己账户名对应的用户到访问权限列表中。

在这里插入图片描述

在这里插入图片描述

  1. 修改自己的访问权限为读与写。

在这里插入图片描述

  1. 将修改应用到当前文件夹以及文件夹下包含的文件中。

在这里插入图片描述

[13:24:06.734] Log Level: 2 [13:24:06.748] SSH Resolver called for "ssh-remote+root", attempt 1 [13:24:06.752] remote.SSH.useLocalServer = false [13:24:06.752] remote.SSH.useExecServer = true [13:24:06.752] remote.SSH.bindHost = {} [13:24:06.752] remote.SSH.showLoginTerminal = false [13:24:06.752] remote.SSH.remotePlatform = {} [13:24:06.754] remote.SSH.path = [13:24:06.754] remote.SSH.configFile = [13:24:06.754] remote.SSH.useFlock = true [13:24:06.754] remote.SSH.lockfilesInTmp = false [13:24:06.754] remote.SSH.localServerDownload = auto [13:24:06.754] remote.SSH.remoteServerListenOnSocket = false [13:24:06.754] remote.SSH.defaultExtensions = [] [13:24:06.754] remote.SSH.defaultExtensionsIfInstalledLocally = [] [13:24:06.754] remote.SSH.loglevel = 2 [13:24:06.755] remote.SSH.enableDynamicForwarding = true [13:24:06.755] remote.SSH.enableRemoteCommand = false [13:24:06.755] remote.SSH.serverPickPortsFromRange = {} [13:24:06.755] remote.SSH.serverInstallPath = {} [13:24:06.755] remote.SSH.permitPtyAllocation = false [13:24:06.755] remote.SSH.preferredLocalPortRange = undefined [13:24:06.755] remote.SSH.useCurlAndWgetConfigurationFiles = false [13:24:06.755] remote.SSH.experimental.chat = true [13:24:06.755] remote.SSH.experimental.enhancedSessionLogs = true [13:24:06.756] remote.SSH.httpProxy = {"*":""} [13:24:06.756] remote.SSH.httpsProxy = {"*":""} [13:24:06.763] VS Code version: 1.101.1 [13:24:06.763] Remote-SSH version: remote-ssh@0.120.0 [13:24:06.763] win32 x64 [13:24:06.765] SSH Resolver called for host: root [13:24:06.765] Setting up SSH remote "root" [13:24:06.771] Using commit id "18e3a1ec544e6907be1e944a94c496e302073435" and quality "stable" for server [13:24:06.771] Extensions to install: [13:24:06.777] Install and start server if needed [13:24:09.050] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\java8path\ssh.exe -V" [13:24:09.051] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\java8path\ssh.exe ENOENT [13:24:09.051] Checking ssh with "C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe -V" [13:24:09.052] Got error from ssh: spawn C:\Program Files (x86)\Common Files\Oracle\Java\javapath\ssh.exe ENOENT [13:24:09.052] Checking ssh with "C:\Windows\system32\ssh.exe -V" [13:24:09.053] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT [13:24:09.053] Checking ssh with "C:\Windows\ssh.exe -V" [13:24:09.053] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT [13:24:09.054] Checking ssh with "C:\Windows\System32\Wbem\ssh.exe -V" [13:24:09.054] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT [13:24:09.054] Checking ssh with "C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V" [13:24:09.055] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT [13:24:09.055] Checking ssh with "C:\Windows\System32\OpenSSH\ssh.exe -V" [13:24:09.073] > OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 [13:24:09.077] Running script with connection command: "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 54688 root sh [13:24:09.077] Generated SSH command: 'type "C:\Users\chen\AppData\Local\Temp\vscode-linux-multi-line-command-root-306797396.sh" | "C:\Windows\System32\OpenSSH\ssh.exe" -T -D 54688 root sh' [13:24:09.078] Using connect timeout of 17 seconds [13:24:09.078] Terminal shell path: C:\Windows\System32\cmd.exe [13:24:09.325] > C:\\Users\\chen/.ssh/config line 3: keyword hostname extra arguments at end of line > C:\\Users\\chen/.ssh/config line 4: keyword user extra arguments at end of line > C:\\Users\\chen/.ssh/config line 5: Bad port '22#'. > C:\\Users\\chen/.ssh/config: terminating, 3 bad configuration options > 过程试图写入的管道不存在。 [13:24:09.325] Got some output, clearing connection timeout [13:24:10.570] "install" terminal command done [13:24:10.570] Install terminal quit with output: 过程试图写入的管道不存在。 [13:24:10.571] Received install output: 过程试图写入的管道不存在。 [13:24:10.571] WARN: $PLATFORM is undefined in installation script output. Errors may be dropped. [13:24:10.571] Failed to parse remote port from server output [13:24:10.571] Resolver error: Error at y.Create (c:\Users\chen\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:744751) at t.handleInstallOutput (c:\Users\chen\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:742832) at t.tryInstall (c:\Users\chen\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:865534) at async c:\Users\chen\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:824246 at async t.withShowDetailsEvent (c:\Users\chen\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:827501) at async A (c:\Users\chen\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:820760) at async t.resolve (c:\Users\chen\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:824898) at async c:\Users\chen\.vscode\extensions\ms-vscode-remote.remote-ssh-0.120.0\out\extension.js:2:1113660 [13:24:10.576] ------ [13:24:10.578] No hints found in the recent session. [13:24:11.043] Opening exec server for ssh-remote+root [13:24:11.056] Initizing new exec server for ssh-remote+root [13:24:11.056] Using commit id "18e3a1ec544e6907be1e944a94c496e302073435" and quality "stable" for server [13:24:11.056] Extensions to install: [13:24:11.122] Opening exec server for ssh-remote+root [13:24:11.125] Install and start server if needed [13:24:13.130] getPlatformForHost was canceled [13:24:13.130] Exec server for ssh-remote+root failed: Error: 已取消连接 [13:24:13.130] Existing exec server for ssh-remote+root errored (Error: 已取消连接) [13:24:13.130] Initizing new exec server for ssh-remote+root [13:24:13.130] Error opening exec server for ssh-remote+root: Error: 已取消连接 [13:24:13.131] No hints found in the recent session. [13:24:13.131] Using commit id "18e3a1ec544e6907be1e944a94c496e302073435" and quality "stable" for server [13:24:13.131] Extensions to install: [13:24:13.133] Install and start server if needed
06-22
评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

codeMak1r.小新

感谢大佬的资瓷!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值