• Error: EACCES: permission denied, symlink


    环境说明

    ganiks@ganiks-ubuntu-trusty-64:/ganiks/parse-server$ npm -v
    6.5.0
    ganiks@ganiks-ubuntu-trusty-64:/ganiks/parse-server$ node -v
    v10.15.0
    

    问题描述

    安装部署 ParseServer服务

    ganiks@ganiks-ubuntu-trusty-64:/ganiks/parse-server$ npm install -g mongodb-runner parse-server
    [..................] / rollbackFailedOptional: verb npm-session d714a710a2e0bbbc
    [..................] / rollbackFailedOptional: verb npm-session d714a710a2e0bbbc
    [..................]  rollbackFailedOptional: verb npm-session d714a710a2e0bbbc
    [..................]  rollbackFailedOptional: verb npm-session d714a710a2e0bbbc
    [..................]  rollbackFailedOptional: verb npm-session d714a710a2e0bbbc
    npm WARN deprecated uws@10.148.1: stop using this version
    npm ERR! path ../lib/node_modules/mongodb-runner/bin/mongodb-runner.js
    npm ERR! code EACCES
    npm ERR! errno -13
    npm ERR! syscall symlink
    npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/mongodb-runner/bin/mongodb-runner.js' -> '/usr/local/bin/mongodb-runner'
    npm ERR!  { [Error: EACCES: permission denied, symlink '../lib/node_modules/mongodb-runner/bin/mongodb-runner.js' -> '/usr/local/bin/mongodb-runner']
    

    这个错误以前遇到过,关键词 symlink permission,意思是没有创建超链接的权限;

    我今天这种环境经常遇到这种问题(Windows宿主机器+Vagrant Ubuntu Host机器)

    解决方案

    给 npm install 添加参数 --no-bin-links

    ganiks@ganiks-ubuntu-trusty-64:/ganiks/parse-server$ npm install -g mongodb-runner parse-server --no-bin-links
    
    + mongodb-runner@4.7.1
    + parse-server@3.1.3
    added 563 packages from 403 contributors in 28.79s
    
    ganiks@ganiks-ubuntu-trusty-64:/ganiks/parse-server$ ls /usr/local/lib/node_modules/ -l
    total 12
    drwxrwxr-x  6 ganiks ganiks 4096 Jan 17 10:23 mongodb-runner
    drwxr-xr-x 10 root    root    4096 Jan 17 08:51 npm
    drwxrwxr-x  7 ganiks ganiks 4096 Jan 17 10:23 parse-server
    

    参考资料

    https://stackoverflow.com/questions/39098812/npm-install-when-to-use-no-bin-links

    One scenario that I can think of is working with a virtual machine (i.e. vagrant w/ virtual box or VMware) on windows host.
    You can't translate symlinks to a synchronized folder on Windows share, so you will need this option to go around it.

    Use it for any filesystem that doesn’t support symbolic links.

    简言之,所有不支持软链接的磁盘系统都需要用到这个 --no-bin-links

    作者:ganiks
    出处:http://www.cnblogs.com/ganiks/
    本作品由 Ganiks 创作, 欢迎转载,但任何转载必须保留完整文章,在显要地方显示署名以及原文链接。如您有任何疑问,请给我留言。
  • 相关阅读:
    sizeof()使用错例:sizeof(i++)
    修改linux命令符和解决命令符太长的问题
    【转载】阻止拷贝的三种方式
    git命令几个总结
    scp用法
    RAII
    a linked list
    c++11之函数式编程实例
    [转]基于SAML的单点登录介绍
    [转]OAuth、OAuth2与OpenID区别和联系
  • 原文地址:https://www.cnblogs.com/ganiks/p/Error-EACCES-permission-denied-symlink.html
Copyright © 2020-2023  润新知