Cygwin Path Error: Cannot find module 'C:\cygdrive\c\…'

帅比萌擦擦* 提交于 2021-02-11 06:54:37

问题


I am using Cygwin on Windows 7 and it was working as expected until I updated it a couple of days ago.

Now when I try to run a makefile for my NodeJs app I get the errors about paths. In error stack I see all the paths have double reference to C drive:

C:\cygdrive\c\...

Update : Reproduced in Git bash, Windows command line and Cygwin shells.

Any ideas how to fix this?


回答1:


Make sure the C:\cygdrive\c path is a native, Windows-style symbolic link to just C:\ as that is the expected behavior of that path.

By default, cygwin creates a UNIX-style symbolic link, which won't work well in many cases. So you need to explicitly tell cygwin what to do here.

Here's how, from inside of Cygwin:

export CYGWIN="winsymlinks:native"
cd C:/cygdrive && rm -rf c && ln -s -v C:/ c



回答2:


If you search for similar question you'll find what you look for. I think this post answers your question quite well https://superuser.com/questions/291818/cygwin-cygdrive-paths-and-windows-command-prompt/291820#291820



来源:https://stackoverflow.com/questions/29172317/cygwin-path-error-cannot-find-module-c-cygdrive-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!