Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Mystery: How Does Running a Node Module (Gatsby) Result in an .steampath Error?

This is a weird question. I'm converting an existing site to Gatsby (a Node package I installed with npm i -g gatsby-cli), and when I run gatsby develop I get an error:

Error: ENOENT: no such file or directory, stat '/home/me/.steampath'

Now the backstory here is that on Linux Steam deliberately installs a bad symbolic link called .steampath for some stupid reason. But what I can't understand is why/how running a specific Node application (Gatsby) could result in this error, which has nothing to do with my project or Gatsby ... when running other Node apps doesn't.

I've done a grep through my project directory: steam doesn't appear in any file. Similarly I grepped my environment (env | grep steam), and there's no environmental variable pointing to that file.

So can anyone answer: why does running Gatsby cause an error in a completely unrelated symbolic link sitting outside the project in my home folder?

I imagine Gatsby must be running some sort of system command, but I can't even imagine what it could run that would scan my home directory and complain about broken symbolic links.

P.S. This error comes at the end, after other errors, so it doesn't look like it's causing gatsby develop to fail so much as it's reporting the error at the end.

P.P.S. Removing the bad symlink does fix things (although I don't know what Steam will think) ... but then I get another error about another broken symlink in my home folder (I can't blame Steam for that one). So something Node/Gatsby is doing is resulting in a scan of my home dir, and a complaint about any broken symlinks found!

Once all broken symlinks are removed Gatsby works normally. So bizarre!

like image 751
machineghost Avatar asked Jun 20 '20 16:06

machineghost


1 Answers

An answer to your question can be found here

I also had this issue today, it surfaced when one of my JS imports was not installed (redux). Adding the dependency fixed the issue. When the dependency was absent from the node_modules directory, something (i didn't dig far enough) would stat my entire home directory. With the dependency present the ~ directory was left alone.

It's related to the node resolution algorithm and although more information is not given, I believe it may be related to this

I was also quite worried when I initially saw this error.

like image 141
Saghen Avatar answered Sep 27 '22 18:09

Saghen