How can I install lstat in macOS?

Viewed 292

I have an application that is dependent on node-gyp package.

The error is: YN0001: │ Error: ENOENT: no such file or directory, lstat '/Users/stefan/MyProject//node_modules/node-gyp'

I was able to install it globally and it works fine. Although when I try to use my app this node-gyp package is dependent on another system command line called lstat which is not present in the latest macOS. I am unable to find resolve this through npm, brew, or MacPorts. Does anybody know how can I add lstat into my macOS?

My system is: MacbookPro 16-inch 2021, apple M1 chip, running on macOS Monterey (12.2.1), XCode 13.3, python 3.8, npm 8.3.1, node v16.14.0

1 Answers

I have a workaround which works for me. I just created a symbolic link called lstat to /usr/bin/stat. Then I could create my react application. Something like:

sudo ln -s /usr/bin/stat /usr/bin/lstat
Related