npm install fails with 'ENOENT: no such file or directory, mkdir' error

37 Views Asked by At

` PS F:\our company\Triyotech India\client> npm i npm ERR! code ENOENT npm ERR! syscall mkdir npm ERR! path \? npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, mkdir '\?' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! Log files were not written due to an error writing to the directory: D:\npm-cache_logs npm ERR! You can rerun the command with --loglevel=verbose to see the logs in your terminal`

how to solve this error

1

There are 1 best solutions below

1
Er SP On

run New-Item -Path "$PWD\.npm-cache" -ItemType Directory -Force

then run

 npm config set cache "$PWD\.npm-cache" 

then run npm install

it work in my case