使用yarn运行一个前端项目时报了个错:

tianlang@tianlang-VirtualBox:/data/code/java/master$ yarn

yarn install v1.22.10

$ echo $npm_execpath | grep -q yarn || echo '\033[0;33mSorry, npm is not supported. Please use Yarn (https://yarnpkg.com/).\033[0m'

[1/5] Validating package.json...

[2/5] Resolving packages...

[3/5] Fetching packages...

info fsevents@1.2.13: The platform "linux" is incompatible with this module.

info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.

info fsevents@2.1.3: The platform "linux" is incompatible with this module.

info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.

[4/5] Linking dependencies...

warning " > @cypress/webpack-preprocessor@4.1.5" has incorrect peer dependency "webpack@^4.18.1".

warning " > @testing-library/cypress@5.3.1" has incorrect peer dependency "cypress@^2.1.0 || ^3.0.0 || ^4.0.0".

warning " > eslint-loader@4.0.2" has incorrect peer dependency "webpack@^4.0.0 || ^5.0.0".

warning " > eslint-plugin-react@6.10.3" has incorrect peer dependency "eslint@^2.0.0 || ^3.0.0".

warning " > postcss-cssnext@2.11.0" has unmet peer dependency "caniuse-db@^1.0.30000652".

error An unexpected error occurred: "EPERM: operation not permitted, symlink '../../../parser/bin/babel-parser.js' -> '/data/code/java/metabase-master/node_modules/@babel/core/node_modules/.bin/parser'".

info If you think this is a bug, please open a bug report with the information provided in "/data/code/java/metabase-master/yarn-error.log".

info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

刚开始以为是babel包没有下载成功导致的,尝试删除依赖重新执行了几次依然不见好转,再仔细检查错误信息,考虑到时创建软链接时出现了问题,直接在命令行中手动创建一个软链接测试:

tianlang@tianlang-VirtualBox:/data/code/java/master$ ln -s yarn-error.log error.log

ln: failed to create symbolic link 'error.log': Operation not permitted

还真是没权限创建软链接,考虑到使用的是Vbox虚拟机,就搜索了下Vbox开启使用软链接的配置:

执行命令前先关闭虚拟机

D:\Program Files\Oracle\VirtualBox>VBoxManage setextradata "elementary" VBoxInternal2/SharedFoldersEnableSymlinksCreate/code 1

其中`elementary`是虚拟机名称,`code`是共享文件夹名称,具体使用方式可以参考:

https://www.cnblogs.com/cxbhakim/p/8882947.html

执行成功后正常启动虚拟机,再次执行创建软链接的命令:

tianlang@tianlang-VirtualBox:/data/code/java/master$ ln -s yarn-error.log error.log

ln: failed to create symbolic link 'error.log': Protocol error

虽然还是没有成功但报错信息不一样了,看来设置已经起作用了,接下来关闭虚拟机,关闭VboxManager, 然后以管理员身份运行VboxManager

再启动虚拟机,执行创建软链接命令,成功创建软链接。

再次执行yarn,也能成功执行了.

在使用cargo编译运行Rust项目tensorbase时也遇到了类似的问题:

Makefile:420: recipe for target 'lib/libjemalloc.so' failed

--- stderr
  ln: failed to create symbolic link 'lib/libjemalloc.so': Protocol error
  make: *** [lib/libjemalloc.so] Error 1
  thread 'main' panicked at 'command did not execute successfully: "make" "-j" "1"
  expected success, got: exit status: 2', /home/tianlang/.cargo/registry/src/github.com-1ecc6299db9ec823/tikv-jemalloc-sys-0.4.1+5.2.1-patched/build.rs:333:9
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

使用同样的方式解决了.

Vbox虚拟机内在共享目录中创建软链接失败相关推荐

  1. 转载 2020-02-18 在KVM主机和虚拟机之间共享目录

    转载于:https://blog.51cto.com/aishangwei/2124526 在KVM主机和虚拟机之间共享目录 (1)在host OS上面创建新的目录和在这个目录里面创建一个文件. mk ...

  2. 三星服务器链接在哪个文件夹,三星手机无线连接,访问局域网电脑共享目录中的电影照片设置教程...

    原标题:三星手机无线连接,访问局域网电脑共享目录中的电影照片设置教程 有时候我们在刷手机的时候需要把手机的资料等传到电脑上,或者把电脑上的资料电影等传到手机上,用软件传又慢,用数据线又麻烦,那么在同局 ...

  3. python 创建目录时间_在目录中创建带有日期时间名称和子文件的dir(Python)

    我目前正在使用pythonv2.7在Linux上创建一个目录,目录名为日期和时间(即27-10-2011 23:00:01).我的密码是以下:在import time import os dirfmt ...

  4. Java 在指定目录中创建文件

    使用 File 类的 file.createTempFile() 方法在指定目录中创建文件 完整代码 import java.io.File;public class Main {public sta ...

  5. Java 文件操作二(重命名、设置只读、是否存在、指定目录中创建文件、获取文件修改日期、创建文件、文件路径比较)

    文件重命名 import java.io.File;public class Main {public static void main(String[] args) {File oldName = ...

  6. 【解决打开远程共享目录中的word、excel、ppt文档失败】

    环境:windows 10   office2016 问题描述:远程打开远程服务器中的共享目录中的word.excel.ppt文件打开失败,显示文件已损坏.但在远程服务器中可以正常打开,文件本身没有问 ...

  7. 在KVM主机和虚拟机之间共享目录

    执行以下步骤: (1)在host OS上面创建新的目录和在这个目录里面创建一个文件. root@kvm:~# mkdir /tmp/shared root@kvm:~# touch /tmp/shar ...

  8. nfs服务共享目录的创建

    1. 设置共享目录 运行命令 #gedit /etc/exports 编辑nfs服务的配置文件(注意:第一次打开时该文件是空的),添加以下内容: /opt/tmp  *(rw,sync,no_root ...

  9. vbox虚拟机异常掉电导致linux启动失败

    背景介绍 host:windows系统.virtualbox:centos系统. 在vbox虚拟机centos运行的同时,host开了很多程序,某个时刻出现大量的内存访问越界弹窗等问题,于是人工强制关 ...

最新文章

  1. 2018AI和机器学习界的12个重大收购案
  2. python pandas读取excel-Python使用Pandas读写Excel实例解析
  3. 第11章:Shell编程
  4. 手机键鼠映射软件_吃鸡,我最专业!---盖世小鸡键鼠吃鸡套装评测
  5. 完整的WebApplication JSF EJB JPA JAAS –第2部分
  6. Qt创建工程及导入资源图片
  7. sqlite C/C++ API
  8. Unity下一轮最大的变革-Entity Component System C# Jobs System
  9. dhcp服务器分配指定ip,DHCP服务(自动分配IP、绑定固定IP)
  10. 【BZOJ5100】[POI2018]Plan metra 构造
  11. 自定义LinkedList实现
  12. java infinite or nan,java.lang.NumberFormatException: Infinite or NaN(数学运算错
  13. 姿态估计4-06:voxelpose(多视角3D人体姿态估算)-源码无死角解析(1)-训练代码总览
  14. 原生android ui设计,在拟物和扁平之间寻找平衡:原生安卓UI设计进化史
  15. python数据分析实验报告心得_Python实训周总结
  16. 【应用安全】“我的QQ被盗,请大家不要相信任何消息.......”
  17. 超级玛丽3通关指南+隐藏点整理
  18. python-pep8规范
  19. Android JNI开发入门与实战
  20. 《布尔教育php设计模式教程 共17课 》完整版

热门文章

  1. TVD$XTAT在linux下安装使用详解
  2. 赞同科技产品开发部诚聘软件工程师
  3. ijk的那些事(一)编译项目
  4. .NET框架体系结构(一部分)
  5. 新闻稿发布中没题材咋办?
  6. CentOS7 nginx反向代理TCP端口
  7. 一篇文章看懂三种存储方式DAS、NAS、SAN
  8. 【路径规划】基于FMM快速行进法实现船舶路径规划附matlab代码
  9. 2021年程序员薪资和生活现状调查,就等你的参与了!
  10. Python C/S 网络编程(三)之 TCP 实现远程骰宝游戏