Node-modules and Cordova installation is failed in ionic 4

sudo npm i -g cordova trying this in mac terminal

npm WARN rollback Rolling back cordova-fetch@2.0.1 failed (this is probably harmless): EILSEQ: illegal byte sequence, rmdir ‘/usr/local/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/fs-extra’ npm ERR! code EILSEQ npm ERR! syscall rmdir npm ERR! path /usr/local/lib/node_modules/cordova/node_modules/.cordova-fetch.DELETE npm ERR! errno -92 npm ERR! EILSEQ: illegal byte sequence, rmdir ‘/usr/local/lib/node_modules/cordova/node_modules/.cordova-fetch.DELETE’

npm ERR! A complete log of this run can be found in: npm ERR! /Users/mac/.npm/_logs/2020-01-10T10_23_00_442Z-debug.log

npm install command tried visual studio in project location i am getting

npm ERR! code EILSEQ npm ERR! syscall rmdir npm ERR! path /Users/mac/Desktop/TranscendDesk/RajIonic/Cosmomo/node_modules/.staging/source-map-941bb91d npm ERR! errno -92 npm ERR! EILSEQ: illegal byte sequence, rmdir ‘/Users/mac/Desktop/TranscendDesk/RajIonic/Cosmomo/node_modules/.staging/source-map-941bb91d’

npm ERR! A complete log of this run can be found in: npm ERR! /Users/mac/.npm/_logs/2020-01-10T10_25_04_934Z-debug.log

Two things:

  1. There is no good reason to ever run npm (or any other part of your Ionic development experience) under sudo, and cleaning things up after having done so even once can be extremely time-consuming and tedious. nvm is your friend.

  2. I understand how frustrating this is for the vast numbers of programmers whose entire lives aren’t conducted in English, but it’s an unfortunate fact of life that, at least as of today, the npm ecosystem tends to perform much more reliably when the entire contents of directory paths consist only of a restricted set of characters. I try to limit myself to [a-zA-z0-9._-]+. Inability to deal with unexpected character encoding sounds like a possible cause of EILSEQ.

1 Like

Thanks for replaying @rapropos, how to prevent these type of errors in future give some suggestions, it will help me a lot.