gpt4 book ai didi

bash - 在 Flutter 安装中通过添加路径的名称找到一个交换文件

转载 作者:行者123 更新时间:2023-12-04 10:44:27 25 4
gpt4 key购买 nike

我正在学习有关 Flutter 开发的在线教程,但我已经被 Flutter 的安装所困扰。

当我尝试将 Flutter 的路径添加到我的计算机(macOS Mojave 10.14.6)时:

vim .bash_profile

我收到了这条消息:
Found a swap file by the name ".bash_profile.swp"
owned by: username dated: Wed Jan 15 01:04:29 2020
file name: ~username/.bash_profile
modified: YES
user name: username host name: name's-Air-2.local.tld
process ID: 44340
While opening file ".bash_profile"
dated: Wed Jan 15 00:27:39 2020

(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r .bash_profile"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".bash_profile.swp"
to avoid this message.

Swap file ".bash_profile.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

R R(ecover) 我得到:
Found a swap file by the name ".bash_profile.swp"
owned by: giuliopiccolo dated: Wed Jan 15 01:04:29 2020
file name: ~giuliopiccolo/.bash_profile
modified: YES
user name: giuliopiccolo host name: Giulios-Air-2.local.tld
process ID: 44340
While opening file ".bash_profile"
dated: Wed Jan 15 00:27:39 2020

(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r .bash_profile"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".bash_profile.swp"
to avoid this message.

Swap file ".bash_profile.swp" already exists!
".bash_profile" 46L, 1556C
Swap files found:
Using specified name:
1. .bash_profile.swm
owned by: username dated: Wed Jan 15 01:08:49 2020
file name: ~username/.bash_profile
modified: YES
user name: username host name: users-Air-2.local.tld
process ID: 47151
2. .bash_profile.swn
owned by: username dated: Wed Jan 15 00:54:07 2020
file name: ~username/.bash_profile
modified: YES
user name: username host name: users-Air-2.local.tld
process ID: 38584
3. .bash_profile.swo
owned by: username dated: Wed Jan 15 00:51:29 2020
file name: ~username/.bash_profile
modified: YES
user name: username host name: users-Air-2.local.tld
process ID: 37177
4. .bash_profile.swp
owned by: username dated: Wed Jan 15 01:04:29 2020
file name: ~username/.bash_profile
modified: YES
user name: username host name: users-Air-2.local.tld
process ID: 44340
In directory ~/tmp:
-- none --
In directory /var/tmp:
-- none --
In directory /tmp:
-- none --

Enter number of swap file to use (0 to quit):

我该如何处理?

其实我不知道这是什么 bash.profile s 代表。

编辑:曾经 D(eleted) .swp文件并重新启动 Flutter 的安装我从 Python(?) 收到了这条消息:
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH

##
# Your previous /Users/username/.bash_profile file was backed up
as /Users/username/.bash_profile.macports-saved_2019-02-
04_at_23:35:45
##

# MacPorts Installer addition on 2019-02-04_at_23:35:45: adding an
appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with
MacPorts.

# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda'
shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/anaconda3/etc/profile.d/conda.sh" # commented out by conda
initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/anaconda3/bin/conda' 'shell.bash' 'hook' 2>
/dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

~
~
~
~
~
~
~
~
".bash_profile" 46L, 1556C

这个时候我该怎么办?

最佳答案

您可以删除 .swp文件。它只是一个文件,Vim 在保存之前将其更改缓存到其中。您可能之前正在编辑该文件并毫不客气地退出vim,因此无法删除.swp文件关闭前。

您的 .bash_profile是当您打开终端时 bash 读取的文件。这是保存您的 bash 首选项的地方。您在 .bash_profile 中更新 PATH 并在您打开终端时读取该路径。

关于bash - 在 Flutter 安装中通过添加路径的名称找到一个交换文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59772406/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com