Giter Club home page Giter Club logo

Comments (22)

therocco avatar therocco commented on June 29, 2024 90

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

from wsl.

allenleexyz avatar allenleexyz commented on June 29, 2024 25

Just sudo npm install -g [email protected]

from wsl.

Loongphy avatar Loongphy commented on June 29, 2024 10

If you are using vs code, close it!

from wsl.

Sparticuz avatar Sparticuz commented on June 29, 2024 4

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

from wsl.

filipeaguiar avatar filipeaguiar commented on June 29, 2024 2

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

from wsl.

aqeebimtiaz avatar aqeebimtiaz commented on June 29, 2024 2

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!

from wsl.

ThaJay avatar ThaJay commented on June 29, 2024 1

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.

from wsl.

cowens avatar cowens commented on June 29, 2024

How did you try to install npm?

from wsl.

Sparticuz avatar Sparticuz commented on June 29, 2024

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

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

from wsl.

ThaJay avatar ThaJay commented on June 29, 2024

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'

from wsl.

sergiogarciadev avatar sergiogarciadev commented on June 29, 2024

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.

from wsl.

Sparticuz avatar Sparticuz commented on June 29, 2024

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/

from wsl.

sergiogarciadev avatar sergiogarciadev commented on June 29, 2024

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

from wsl.

filipeaguiar avatar filipeaguiar commented on June 29, 2024

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.

from wsl.

Sparticuz avatar Sparticuz commented on June 29, 2024

More info here: microsoft/WSL#3

from wsl.

aswathykrishna18 avatar aswathykrishna18 commented on June 29, 2024

$ 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

from wsl.

racibaz avatar racibaz commented on June 29, 2024

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:))

from wsl.

razonklnbd avatar razonklnbd commented on June 29, 2024

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.

from wsl.

ShivanshSharma1 avatar ShivanshSharma1 commented on June 29, 2024

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

from wsl.

CodeWithHiteshYT avatar CodeWithHiteshYT commented on June 29, 2024

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...!!

from wsl.

killroy42 avatar killroy42 commented on June 29, 2024

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...

from wsl.

tetris-dev-web avatar tetris-dev-web commented on June 29, 2024

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

from wsl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.