[英]EOENT esprima esparse Windows symlinks invalid directory file not found
I'm taking over an outdated electron-webpack + react app, and my build is always getting this error:我正在接管一个过时的电子 webpack + react 应用程序,我的构建总是出现这个错误:
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我发现 esprima 在它的 .bin 文件夹中创建了 esparse 的符号链接,但是尝试在资源管理器中打开符号链接会给出一个“无效目录”警告框,所以我认为这与 ENOENT 有关
Any clue how to resolve this?任何线索如何解决这个问题?
This may have something to do with yarn.这可能与纱线有关。 When I do a yarn install, it adds the symlinked .bin folder to the esprima package.当我进行 yarn 安装时,它会将符号链接的 .bin 文件夹添加到 esprima 包中。 An npm install doesn't. npm install 没有。 I deleted the node_modules folder, ran npm i
, and then yarn dist
, and all seemed well.我删除了 node_modules 文件夹,运行npm i
,然后运行yarn dist
,一切看起来都很好。
Let me know how this works for you!让我知道这对你有什么作用!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.