Comments (22)
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.
Just sudo npm install -g [email protected]
from wsl.
If you are using vs code, close it!
from wsl.
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.
I've got a similar error when trying to install node and npm using nvm
from wsl.
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.
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.
How did you try to install npm?
from wsl.
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.
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.
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.
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.
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.
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.
More info here: microsoft/WSL#3
from wsl.
$ 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.
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.
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.
Fix the code if the deploy log in Netlify gives any error or warning and it will deploy.
from wsl.
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.
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.
INSTALL GLOBAL NPM PACKAGES
npm config set unsafe-perm trueCLEAN CACHE
npm cache cleanBYPASS SYMLINK ISSUES
npm install --no-bin-links
It's working... perfect
from wsl.
Related Issues (20)
- Typing Error on the landing page HOT 1
- surface pro 11 and wsl HOT 1
- Test Issue
- Add example for hostAddressLoopback HOT 1
- windows subsystem for linux HOT 1
- Op
- Erroneous (or unclear) instructions for manual WSL install
- Windows Server 2019 -- not working
- Damarcus Ai Chips HOT 2
- Nautilus requires `dbus-x11` on Debian to save preferences
- REGDB_E_CLASSNOTREG HOT 4
- -wsl HOT 1
- powershell wsl 系统找不到指定的文件。 HOT 1
- Misleading `umask` documentation
- wsl --version advice from learn docs => Invalid command line option HOT 2
- Need more information about error messages and possible solutions for that HOT 1
- Microsoft Store for Business is retired HOT 1
- Pi Network HOT 2
- Why is not there Windows Terminal for windows server 2022 in Microsoft Store? HOT 1
- the re-install issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsl.