1

Our application is built on MEAN stack, and recently we have come across an issue that was never a problem.

A code change was made, and Ctrl-M characters are being added automatically. This happens to only one js and html file. All others do not have any problem.

Please find a git diff, below.

        new CronJob("01 * * * * *", function () {
-               console.log("Notify cron");
+               console.log("Notify Cron");^M
                notificationController.notifyCron();
        }, null, true, 'America/Los_Angeles');
        new CronJob("01 * * * * *", function () {
-               console.log("Notify cron");
+               console.log("Notify Cron Message");^M
                notificationController.notifyCronMessage();
     }, null, true, 'America/Los_Angeles');

A screenshot, too... screenshot

Notice that the modified lines have an additional character inserted. I have researched almost everything available on this issue, and there are solutions that allow us to change on the linux server.

But, I would want this to not happen at all. I use Visual Studio Code on macOS...

Any help would be greatly appreciated.

Shyam
  • 561
  • 5
  • 22

1 Answers1

0

I guess you have changes the files using windows.

^M at the end of every line in vim

use dos2unix if you want to convert the file back to linux line ending.

Gokul C
  • 151
  • 14