EOENT esprima esparse Windows symlinks invalid directory file not found

378 views Asked by At

I'm taking over an outdated electron-webpack + react app, and my build is always getting this error:

Cannot read file C:\Users\baz\Desktop\foo-bar-app\node_modules\esprima\.bin\esparse: Error: ENOENT: no such file or directory, open 'C:\Users\baz\Desktop\foo-bar-app\node_modules\esprima\.bin\esparse' at w (C:\Users\baz\Desktop\foo-bar-app\node_modules\app-builder-lib\src\asar\asarUtil.ts:201:11) at writeStream.write (C:\Users\baz\Desktop\foo-bar-app\node_modules\app-builder-lib\src\asar\asarUtil.ts:203:43) at afterWrite (_stream_writable.js:480:3) at onwrite (_stream_writable.js:471:7) at lazyFs.write (internal/fs/streams.js:304:5) at FSReqWrap.wrapper [as oncomplete] (fs.js:502:5) error Command failed with exit code 1.

I found that esprima creates symlinks to esparse in it's .bin folder, but trying to open the symlinks in explorer gives an "invalid directory" alert box, so I assume that is related to the ENOENT

Any clue how to resolve this?

1

There are 1 answers

1
jpetitte On BEST ANSWER

This may have something to do with yarn. When I do a yarn install, it adds the symlinked .bin folder to the esprima package. An npm install doesn't. I deleted the node_modules folder, ran npm i, and then yarn dist, and all seemed well.

Let me know how this works for you!