Skip to content

npm install failing. Symlink problems? #26

Closed

Description

npm ERR! Linux 3.4.0+
npm ERR! argv "/usr/bin/nodejs" "/usr/local/bin/npm" "install"
npm ERR! node v4.4.2
npm ERR! npm v3.8.5
npm ERR! path ../mime/cli.js
npm ERR! code EPERM
npm ERR! errno -1
npm ERR! syscall symlink

npm ERR! Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/mnt/c/users/kyle/Documents/dev/listomaniapi/node_modules/.bin/mime'
npm ERR! at Error (native)
npm ERR! { [Error: EPERM: operation not permitted, symlink '../mime/cli.js' -> '/mnt/c/users/kyle/Documents/dev/listomaniapi/node_modules/.bin/mime']
npm ERR! errno: -1,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'symlink',
npm ERR! path: '../mime/cli.js',
npm ERR! dest: '/mnt/c/users/kyle/Documents/dev/listomaniapi/node_modules/.bin/mime',
npm ERR! parent: 'listomaniapi' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /mnt/c/users/kyle/Documents/dev/listomaniapi/npm-debug.log
npm ERR! code 1
root@localhost:~/dev/listomaniapi#

Activity

  1. cowens commented on Apr 7, 2016

    @cowens

    How did you try to install npm?

  2. Sparticuz commented on Apr 7, 2016

    @Sparticuz
    Author

    curl -sL https://deb.nodesource.com/setup_4.x | bash -
    apt-get install nodejs

    It's what is on nodejs.org's site

  3. filipeaguiar commented on Apr 7, 2016

    @filipeaguiar

    I've got a similar error when trying to install node and npm using nvm

  4. ThaJay commented on Apr 7, 2016

    @ThaJay

    same thing here.
    A subdependency would love to make a symlink, and npm i fails because it can't.
    We have symlinks in cmd through mklink /J so I don't really get why it's not possible through WSL yet.

    npm ERR! Error: EPERM, symlink '../JSONStream/index.js'
    npm ERR!  { [Error: EPERM, symlink '../JSONStream/index.js'] errno: 50, code: 'EPERM', path: '../JSONStream/index.js' }
    npm ERR!
    npm ERR! Please try running this command again as root/Administrator.
    
    npm ERR! System Linux 3.4.0+
    npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "i"
    npm ERR! cwd /mnt/c/dev/scan-app
    npm ERR! node -v v0.10.25
    npm ERR! npm -v 1.3.10
    npm ERR! path ../JSONStream/index.js
    npm ERR! code EPERM
    npm ERR! errno 50
    npm ERR! stack Error: EPERM, symlink '../JSONStream/index.js'
    
  5. therocco commented on Apr 7, 2016

    @therocco

    Using this I've had some luck installing some npm modules, but it still does have issues with permission errors whenever npm tries to rename a file.

    INSTALL GLOBAL NPM PACKAGES
    npm config set unsafe-perm true

    CLEAN CACHE
    npm cache clean

    BYPASS SYMLINK ISSUES
    npm install --no-bin-links

  6. Sparticuz commented on Apr 7, 2016

    @Sparticuz
    Author

    We have symlinks in cmd through mklink /J so I don't really get why it's not possible through WSL yet.

    What's odd is the ln -s seems to work fine

  7. sergiogarciadev commented on Apr 7, 2016

    @sergiogarciadev

    In my tests, using pip, I was unable to create a virtualenv in my user folder.

    root@localhost:/mnt/c/Users/sergi/demoubuntu# virtualenv py27
    New python executable in py27/bin/python
    Traceback (most recent call last):
      File "/usr/bin/virtualenv", line 3, in <module>
        virtualenv.main()
      File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 825, in main
        symlink=options.symlink)
      File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 985, in create_environment
        site_packages=site_packages, clear=clear, symlink=symlink))
      File "/usr/lib/python2.7/dist-packages/virtualenv.py", line 1405, in install_python
        os.symlink(py_executable_base, full_pth)
    OSError: [Errno 1] Operation not permitted
    

    But was able to create inside Ubuntu filesystem

    root@localhost:/home# virtualenv py27
    New python executable in py27/bin/python
    Installing setuptools, pip...done.
    
  8. Sparticuz commented on Apr 7, 2016

    @Sparticuz
    Author

    I think you've got the ln -s backwards, mine created just fine inside bash
    lrwxrwxrwx 1 root root 31 Apr 7 01:24 dev -> /mnt/c/users/kyle/Documents/dev/

  9. ThaJay commented on Apr 8, 2016

    @ThaJay

    I was unable to use ln -s on /mnt/c/ (Operation not permitted) but it did work for me in the unix filesystem, for instance at ~/. a symlink created through mklink /J in cmd showed up in my bash, but it did look a bit strange (same for normal mklink):

    $ l
    ls: cannot access core: Input/output error
    total 8.0K
    d????????? ? ?    ?       ?            ? core/
    -rwxrwxrwx 1 root root 1.2K Apr  7 15:54 index.js*
    drwxrwxrwx 2 root root    0 Mar 31 16:14 subcomponents/
    drwxrwxrwx 2 root root    0 Mar 31 16:14 viewcomponents/
    

    thanks nerdofsteel for the suggestions. I too ran into the rename issue when trying to globally install a module. The no symlinks option seems to work like a charm for my local dependencies.

  10. sergiogarciadev commented on Apr 8, 2016

    @sergiogarciadev

    I think the problem for both virtualenv and npm is that those tools tries to create links to the Lxss filesystem.

    root@localhost:/mnt/c/Users/sergi# ln -s /root .
    ln: failed to create symbolic link ‘./root’: Operation not permitted
    
  11. filipeaguiar commented on Apr 9, 2016

    @filipeaguiar

    It appears to be a problem with tar. It doesn't create symlinks ever. Every tool that I've tried to install that uses tar with symlinks fails.

  12. Sparticuz commented on Apr 12, 2016

    @Sparticuz
    Author

    More info here: microsoft/WSL#3

  13. allenv0 commented on Jan 13, 2018

    @allenv0

    Just sudo npm install -g [email protected]

  14. aswathykrishna18 commented on Jan 16, 2018

    @aswathykrishna18

    $ npm install -g npm
    C:\Users\aswathy\AppData\Roaming\npm\npx -> C:\Users\aswathy\AppData\Roaming\npm\node_modules\npm\bin\npx-cli.js
    npm ERR! path C:\Users\aswathy\AppData\Roaming\npm\npm
    npm ERR! code EPERM
    npm ERR! errno -4048
    npm ERR! syscall open
    npm ERR! Error: EPERM: operation not permitted, open 'C:\Users\aswathy\AppData\Roaming\npm\npm'
    npm ERR! { Error: EPERM: operation not permitted, open 'C:\Users\aswathy\AppData\Roaming\npm\npm'
    npm ERR! cause:
    npm ERR! { Error: EPERM: operation not permitted, open 'C:\Users\aswathy\AppData\Roaming\npm\npm'
    npm ERR! errno: -4048,
    npm ERR! code: 'EPERM',
    npm ERR! syscall: 'open',
    npm ERR! path: 'C:\Users\aswathy\AppData\Roaming\npm\npm' },
    npm ERR! stack: 'Error: EPERM: operation not permitted, open 'C:\Users\aswathy\AppData\Roaming\npm\npm'',
    npm ERR! errno: -4048,
    npm ERR! code: 'EPERM',
    npm ERR! syscall: 'open',
    npm ERR! path: 'C:\Users\aswathy\AppData\Roaming\npm\npm' }
    npm ERR!
    npm ERR! Please try running this command again as root/Administrator.

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:\Users\aswathy\AppData\Roaming\npm-cache_logs\2018-01-16T10_46_38_513Z-debug.log

  15. racibaz commented on May 29, 2020

    @racibaz

    Using this I've had some luck installing some npm modules, but it still does have issues with permission errors whenever npm tries to rename a file.

    INSTALL GLOBAL NPM PACKAGES
    npm config set unsafe-perm true

    CLEAN CACHE
    npm cache clean

    BYPASS SYMLINK ISSUES
    npm install --no-bin-links

    Thank. It's working:))

  16. aqeebimtiaz commented on May 29, 2020

    @aqeebimtiaz

    Using this I've had some luck installing some npm modules, but it still does have issues with permission errors whenever npm tries to rename a file.

    INSTALL GLOBAL NPM PACKAGES
    npm config set unsafe-perm true

    CLEAN CACHE
    npm cache clean

    BYPASS SYMLINK ISSUES
    npm install --no-bin-links

    This worked like a charm! Thank you!

  17. razonklnbd commented on Oct 18, 2020

    @razonklnbd

    In my case I mount vfat into media so my ubuntu can't create symlinks into that mount point and raise this kind of error.

  18. ShivanshSharma1 commented on Nov 3, 2020

    @ShivanshSharma1

    Fix the code if the deploy log in Netlify gives any error or warning and it will deploy.

  19. CodeWithHiteshYT commented on Dec 4, 2020

    @CodeWithHiteshYT

    Using this I've had some luck installing some npm modules, but it still does have issues with permission errors whenever npm tries to rename a file.

    INSTALL GLOBAL NPM PACKAGES
    npm config set unsafe-perm true

    CLEAN CACHE
    npm cache clean

    BYPASS SYMLINK ISSUES
    npm install --no-bin-links

    Thanks it worked...!!

  20. Loongphy commented on May 18, 2021

    @Loongphy

    If you are using vs code, close it!

  21. killroy42 commented on Jun 29, 2021

    @killroy42

    I ran into symlink issues with weird relative paths:
    Error: EACCES: permission denied, symlink '../../../lib/node_modules/npm/man/man5/npm-shrinkwrap-json.5' -> '/usr/share/man/man5/npm-shrinkwrap-json.5'

    And now npm is borked, as the rollback failed...

  22. tetris-dev-web commented on Feb 19, 2022

    @tetris-dev-web

    INSTALL GLOBAL NPM PACKAGES
    npm config set unsafe-perm true

    CLEAN CACHE
    npm cache clean

    BYPASS SYMLINK ISSUES
    npm install --no-bin-links

    It's working... perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions