Cli: [BUG] Development crashes due to Emacs' temp files

Created on 31 May 2020  路  1Comment  路  Source: npm/cli

What / Why

I am using GNU Emacs to develop. Emacs saves files automatically in temporary files during unsaved changes. These temporary files have names starting with .#.

npm start crashes whenever I make an unsaved change to a file file in the project directory. According to the error message, it is highly likely that npm is having trouble dealing with those auto-saved .# files from Emacs.

When

  • Whenever I change a file, npm start will crash.

Where

  • n/a

How

  • n/a

Current Behavior

npm start crashes whenever I make a change to a file.

Steps to Reproduce

Run npm start in a React project (possibly created with create-react-app), use GNU Emacs to make a change to any file in the project.

Expected Behavior

npm should live update my changes on localhost (3000).

Who

  • n/a

References

  • A similar issue from Gatsby https://github.com/gatsbyjs/gatsby/issues/2347

  • According to the error message, I can be sure that it's the Emacs auto-saved temporary files that start with .# that are causing troubles. Is there a way for npm start to ignore those files?

  • I opened an issue here with detailed error message and log file.

>All comments

[Solved]

Turns out that those aren't auto-saved temp files, but rather symbolic link files.

If you're using Emacs and those .# files trouble your development flow, try this option in your init.el (Emacs configuration file):

(setq create-lockfiles nil)

This will disable the creation of symlink files.

References:

Was this page helpful?
0 / 5 - 0 ratings