create-react-app在virtualbox debian中的共享文件夹中无法正常工作 - 符号链接错误

时间:2017-08-22 06:53:40

标签: linux reactjs symlink create-react-app

我已经在Windows 10上的VirtualBox中安装了Debian 9,并且我有共享文件夹,所以我可以使用Windows上的编辑器访问Linux上的项目。 我为react项目安装了nodejs,npm和create-react-app。 Create-react-app安装在非共享文件夹中,但是当我必须创建一个新项目时,我必须转到共享文件夹,以便我可以从Windows访问以响应我使用create-react-app创建的应用程序。 / p>

但我一直收到错误,对于符号链接,我已经安装了npm with no-bin links命令,我也尝试过在StackOverflow和其他地方找到的所有内容。所以,如果有人遇到同样的问题,他会修复它吗?

我正在使用php laravel来构建API,我需要使用react for frontend,所以如果有人可能会使用其他一些解决方案,那么我通常可以使用Windows和虚拟机以及共享文件夹。它不一定是create-react-app,但在我看来,这似乎是创建反应应用程序的一个快速而快速的解决方案。但我会接受任何其他解决方案,以便与共享文件夹进行反应。

以下是错误。

npm ERR! Linux 4.9.0-3-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
npm ERR! node v6.11.2
npm ERR! npm  v3.10.10
npm ERR! path ../acorn/bin/acorn
npm ERR! code EROFS
npm ERR! errno -30
npm ERR! syscall symlink

npm ERR! rofs EROFS: read-only file system, symlink '../acorn/bin/acorn' -> '/media/sf_debianShared/frontend/test/node_modules/.bin/acorn'
npm ERR! rofs This is most likely not a problem with npm itself
npm ERR! rofs and is related to the file system being read-only.
npm ERR! rofs
npm ERR! rofs Often virtualized file systems, or other file systems
npm ERR! rofs that don't support symlinks, give this error.

npm ERR! Please include the following file with any support request:
npm ERR!     /media/sf_debianShared/frontend/test/npm-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... node_modules
Deleting generated file... npm-debug.log
Deleting generated file... package.json
Deleting test / from /media/sf_debianShared/frontend
Done.

1 个答案:

答案 0 :(得分:1)

不建议使用Windows文件夹,没有解决方案。您必须在debian中创建文件夹,并与windows共享samba,这会更慢

http://www.virtualbox.org/manual/ch04.html#sharedfolders "从版本4.0开始,VirtualBox共享文件夹在以下条件下也支持符号链接(符号链接):

主机操作系统必须支持符号链接(即需要Mac,Linux或Solaris主机)。"

相关问题