【问题标题】:How to fix nodejs throw err; ^ Error: ENOENT: no such file or directory, open如何修复 nodejs 抛出错误; ^ 错误:ENOENT:没有这样的文件或目录,打开
【发布时间】:2021-01-15 01:35:26
【问题描述】:

这就是我的输出的样子。我已经从以前的类似问题中用尽了很多方法,但没有一个对我有用。我对 node js 很陌生,所以任何建议都会很有帮助-

C:\Users\pushp\Desktop\factor>snarkjs --help
internal/fs/utils.js:230
    throw err;
    ^

Error: ENOENT: no such file or directory, open '\C:\Users\pushp\AppData\Roaming\npm\node_modules\snarkjs\package.json'
[90m    at Object.openSync (fs.js:458:3)[39m
[90m    at Object.readFileSync (fs.js:360:35)[39m
    at Object.<anonymous> (C:\Users\pushp\AppData\Roaming\npm\node_modules\[4msnarkjs[24m\build\cli.cjs:1228:15)
[90m    at Module._compile (internal/modules/cjs/loader.js:1138:30)[39m
[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)[39m
[90m    at Module.load (internal/modules/cjs/loader.js:986:32)[39m
[90m    at Function.Module._load (internal/modules/cjs/loader.js:879:14)[39m
[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)[39m
[90m    at internal/main/run_main_module.js:17:47[39m {
  errno: [33m-4058[39m,
  syscall: [32m'open'[39m,
  code: [32m'ENOENT'[39m,
  path: [32m'\\C:\\Users\\pushp\\AppData\\Roaming\\npm\\node_modules\\snarkjs\\package.json'[39m
}

【问题讨论】:

    标签: javascript node.js


    【解决方案1】:

    看起来这是known bug in the module。您可以尝试按照问题中的建议修补他们的代码,或者(我个人建议)设置 WSL,这样您就不必在 Windows 上处理尽可能多的不一致问题。或者您可以向该模块提交拉取请求以解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-10
      • 2018-07-06
      • 1970-01-01
      • 2019-01-26
      • 2021-06-08
      • 2021-05-21
      • 1970-01-01
      • 2019-06-24
      相关资源
      最近更新 更多