Presently, I am attempting to create a PHP laravel app and install some nodejs
dependencies on wsl-2
but am getting the following errors (cf. https://www.linkedin.com/learning/laravel-9-0-essential-training). FYI, I have installed nodejs
v18.16.0:
jdoe@Grieg:~/DevProjects/litenotes$ curl -s https://laravel.build/litenotes | bash
...
jdoe@Grieg:~/DevProjects/litenotes$ ./vendor/bin/sail up
In another terminal:
jdoe@Grieg:~/DevProjects/litenotes$ ./vendor/bin/sail composer require laravel/breeze --dev
...
jdoe@Grieg:~/DevProjects/litenotes$ ./vendor/bin/sail artisan breeze:install
...
jdoe@Grieg:~/DevProjects/litenotes$ npm install
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup [
npm WARN cleanup '\\wsl.localhost\Ubuntu-22.04\home\jdoe\DevProjects\litenotes\node_modules\.bin\he',
npm WARN cleanup [Error: EISDIR: illegal operation on a directory, lstat '\wsl.localhostUbuntu-22.04homejdoeDevProjectslitenotesnode_modules.binhe'] {
npm WARN cleanup errno: -4068,
npm WARN cleanup code: 'EISDIR',
npm WARN cleanup syscall: 'lstat',
npm WARN cleanup path: '\\wsl.localhost\Ubuntu-22.04\home\jdoe\DevProjects\litenotes\node_modules\.bin\he'
npm WARN cleanup }
npm WARN cleanup ],
npm WARN cleanup [
npm WARN cleanup '\\wsl.localhost\Ubuntu-22.04\home\jdoe\DevProjects\litenotes\node_modules\.bin\autoprefixer',
npm WARN cleanup [Error: EISDIR: illegal operation on a directory, lstat '\wsl.localhostUbuntu-22.04homejdoeDevProjectslitenotesnode_modules.binautoprefixer'] {
npm WARN cleanup errno: -4068,
npm WARN cleanup code: 'EISDIR',
npm WARN cleanup syscall: 'lstat',
npm WARN cleanup path: '\\wsl.localhost\Ubuntu-22.04\home\jdoe\DevProjects\litenotes\node_modules\.bin\autoprefixer'
npm WARN cleanup }
npm WARN cleanup ],
npm WARN cleanup [
npm WARN cleanup '\\wsl.localhost\Ubuntu-22.04\home\jdoe\DevProjects\litenotes\node_modules\tailwindcss',
npm WARN cleanup [Error: EPERM: operation not permitted, rmdir '\wsl.localhostUbuntu-22.04homejdoeDevProjectslitenotesnode_modulestailwindcsslib'] {
npm WARN cleanup errno: -4048,
npm WARN cleanup code: 'EPERM',
npm WARN cleanup syscall: 'rmdir',
npm WARN cleanup path: '\\wsl.localhost\Ubuntu-22.04\home\jdoe\DevProjects\litenotes\node_modules\tailwindcss\lib'
npm WARN cleanup }
npm WARN cleanup ]
npm WARN cleanup ]
npm ERR! code EISDIR
npm ERR! syscall lstat
npm ERR! path \wsl.localhostUbuntu-22.04homejdoeDevProjectslitenotesnode_modules.binautoprefixer
npm ERR! errno -4068
npm ERR! EISDIR: illegal operation on a directory, lstat '\wsl.localhostUbuntu-22.04homejdoeDevProjectslitenotesnode_modules.binautoprefixer'
npm ERR! A complete log of this run can be found in: C:UserspsalmAppDataLocalnpm-cache_logs2023-05-14T05_45_26_819Z-debug-0.log
This is my npm version:
jdoe@Grieg:~/DevProjects/litenotes$ npm -v
9.6.6
Also, I have checked the following sites but don’t have a solution yet:
Cannot find module '\wsl.localhostUbuntu-20.04mntcProgram Filesnodejsnode_modulesnpmbinnpm-cli.js'
NPM node_modules/.bin symlinks
Does anyone have any suggestions? TIA.
2
Answers
UPDATE:
Gave up on
wsl
and ended up going withvagrant
: https://www.vagrantup.com/Original answer:
Ran these commands instead (see npm install errors on vagrant/homestead/windows: EPROTO: protocol error, symlink):
Which should then open:
Then you should be able to connect to the
mysql
database using:I have same problem. The problem is on nodejs installation.
To install nodejs in WSL, do not use apt.
Use following guidance from microsoft: