This is a general question I searched a solution for but I couldn't find resonable one.
First: I am building Laravel
apps on homestead
branch 20.04
development environment, everything works fine except when running npm install
on any laravel new project I start receiving many errors for example:
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /home/vagrant/code/marketing/node_modules/resolve-url-loader/node_modules/postcss
npm ERR! dest /home/vagrant/code/marketing/node_modules/resolve-url-loader/node_modules/.postcss.DELETE
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/home/vagrant/code/marketing/node_modules/resolve-url-loader/node_modules/postcss' -> '/home/vagrant/code/marketing/node_modules/resolve-url-loader/node_modules/.postcss.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
and sometimes another error such as:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/code/marketing/node_modules/babel-merge/node_modules/ms/package.json.822514419
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/code/marketing/node_modules/babel-merge/node_modules/ms/package.json.822514419'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
When I delete node_modules
folder and run yarn install
everything works fine without any error:
yarn install v1.22.5
info No lockfile found.
[1/4] Resolving packages...
warning laravel-mix > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning laravel-mix > webpack-dev-server > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning laravel-mix > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning laravel-mix > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning laravel-mix > chokidar > braces > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning laravel-mix > chokidar > braces > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning resolve-url-loader > rework > css > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
warning file-loader@2.0.0: Invalid bin field for "file-loader".
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.3: The platform "linux" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 60.60s.
Can anybody explain why is this happening,
My Host OS: Windows 10 NodeJS: V14.15.1 Virtual Box: 6.1.12 r139181
Thanx,