安装git后,在对话框中看到以下内容:“无法运行安装后脚本”。 每次打开git bash时,bash上都会显示以下内容: `
mkdir: cannot create directory '/dev/shm': Read-only file system
Creating /dev/shm directory failed.
POSIX semaphores and POSIX shared memory will not work
mkdir: cannot create directory '/dev/mqueue': Read-only file system
Creating /dev/mqueue directory failed.
POSIX message queues will not work
ln: failed to create symbolic link '/dev/stdin': Read-only file system
ln: failed to create symbolic link '/dev/stdout': Read-only file system
ln: failed to create symbolic link '/dev/stderr': Read-only file system
ln: failed to create symbolic link '/dev/fd': Read-only file system
ln: failed to create symbolic link '/etc/mtab': Permission denied
'C:\Windows\system32\drivers\etc\hosts' -> '/etc/hosts'
/usr/bin/cp: cannot create regular file '/etc/hosts': Permission denied
'C:\Windows\system32\drivers\etc\protocol' -> '/etc/protocols'
/usr/bin/cp: cannot create regular file '/etc/protocols': Permission denied
'C:\Windows\system32\drivers\etc\services' -> '/etc/services'
/usr/bin/cp: cannot create regular file '/etc/services': Permission denied
'C:\Windows\system32\drivers\etc\networks' -> '/etc/networks'
/usr/bin/cp: cannot create regular file '/etc/networks': Permission denied
rm: cannot remove '/etc/post-install/01-devices.post': Permission denied
rm: cannot remove '/etc/post-install/03-mtab.post': Permission denied
rm: cannot remove '/etc/post-install/06-windows-files.post': Permission denied
rm: cannot remove '/etc/post-install/99-post-install-cleanup.post': Permission denied
` 可能是什么问题? 会给将来带来麻烦,尤其是在安装软件包时?
答案 0 :(得分:1)
我有同样的问题。解决方案是使用Run as Administrator
选项打开Git Bash。
答案 1 :(得分:0)
首先检查您的%PATH%
。
如果已安装latest Git for Windows,请打开CMD并设置一条简化的路径,以查看在键入该CMD会话“ bash”时这些错误是否仍然存在:
首先输入:
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
set GIT_HOME=C:\Path\to\Git
set PATH=%GIT_HOME%;%GIT_HOME%\bin;%GIT_HOME%\usr\bin;%GIT_HOME%\mingw64\bin;%PATH%
然后:
bash