Giter Club home page Giter Club logo

Comments (10)

vanmoortel avatar vanmoortel commented on July 29, 2024 9

Yes, the problem is that there is a backslash at the beginning of the path.
Here is a temporary fix for windows users:

Update line 1154 of your-project/node_modules/snarkjs/build/cli.cjs
Before:
pkgS = fs.readFileSync(path.join(__dirname$1, "..","package.json"));
After
pkgS = fs.readFileSync(path.join(__dirname$1.slice(1,__dirname$1.length), "..","package.json"));

from snarkjs.

jbaylina avatar jbaylina commented on July 29, 2024 2

This looks like a windows problem..

from snarkjs.

Hengkai-Ye avatar Hengkai-Ye commented on July 29, 2024 2

For 0.3.59, update line 151 of /node_modules/snarkjs/build/cli.cjs with

pkgS = fs__default['default'].readFileSync(path__default['default'].join(__dirname$1.slice(1,__dirname$1.length), "..","package.json"));

from snarkjs.

Komari-Koshigaya avatar Komari-Koshigaya commented on July 29, 2024 1

also for v0.3.59, changed line 5744 of /node_modules/snarkjs/build/cli.cjs to:

templateName = fs__default['default'].readFileSync(path__default['default'].join(__dirname$2.slice(1,__dirname$1.length), "..","templates","verifier_groth16.sol"));

and haven't run into any issues on windows yet.

Is this problem still unresolved?
I have the same problem, and there is another question after taking your approach

F:\tutorial\factor> snarkjs info -c circuit.json
[ERROR] snarkJS: Error: circuit.json: Invalid File format
at Object.readBinFile (G:\ProgrammingSoftware\front-end\node-v14.15.0-win-x64\node_modules\snarkjs\node_modules@iden3\binfileutils\build\main.cjs:16:35)
at async Object.readR1cs (G:\ProgrammingSoftware\front-end\node-v14.15.0-win-x64\node_modules\snarkjs\node_modules\r1csfile\build\main.cjs:112:28)
at async r1csInfo (G:\ProgrammingSoftware\front-end\node-v14.15.0-win-x64\node_modules\snarkjs\build\cli.cjs:154:17)
at async Object.r1csInfo$1 [as action] (G:\ProgrammingSoftware\front-end\node-v14.15.0-win-x64\node_modules\snarkjs\build\cli.cjs:8146:5)
at async clProcessor (G:\ProgrammingSoftware\front-end\node-v14.15.0-win-x64\node_modules\snarkjs\build\cli.cjs:282:21)

from snarkjs.

ddengster avatar ddengster commented on July 29, 2024 1

This problem has re-emerged on windows again, v0.4.15

I fixed it via the this code block in PR #88 : https://github.com/iden3/snarkjs/pull/88/files#diff-479f878ecd4b45fdc75718d1eedb8d4385d08d50264852cc6c0570ec310c1733R152 and changing the __dirname$1 to __dirname$2

from snarkjs.

benjaminstrasser avatar benjaminstrasser commented on July 29, 2024

I am having the same problem

from snarkjs.

calvbore avatar calvbore commented on July 29, 2024

Having this issue on windows as well.

internal/fs/utils.js:269
    throw err;
    ^

Error: ENOENT: no such file or directory, open '\C:\Users\Calvin\AppData\Roaming\npm\node_modules\snarkjs\package.json'
�[90m    at Object.openSync (fs.js:462:3)�[39m
�[90m    at Object.readFileSync (fs.js:364:35)�[39m
    at Object.<anonymous> (C:\Users\Calvin\AppData\Roaming\npm\node_modules\�[4msnarkjs�[24m\build\cli.cjs:1310:35)
�[90m    at Module._compile (internal/modules/cjs/loader.js:1137:30)�[39m
�[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)�[39m
�[90m    at Module.load (internal/modules/cjs/loader.js:985:32)�[39m
�[90m    at Function.Module._load (internal/modules/cjs/loader.js:878: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\\Calvin\\AppData\\Roaming\\npm\\node_modules\\snarkjs\\package.json'�[39m
}

from snarkjs.

calvbore avatar calvbore commented on July 29, 2024

also for v0.3.59, changed line 5744 of /node_modules/snarkjs/build/cli.cjs to:

templateName = fs__default['default'].readFileSync(path__default['default'].join(__dirname$2.slice(1,__dirname$1.length), "..","templates","verifier_groth16.sol"));

and haven't run into any issues on windows yet.

from snarkjs.

tippi-fifestarr avatar tippi-fifestarr commented on July 29, 2024

Using Node 14.15.0 npm install -g snarkjs@latest installs "correctly" but no node_modules or package.json are created

from snarkjs.

phated avatar phated commented on July 29, 2024

I believe this was fixed by #131 - please update to snarkjs 0.4.16 and try again.

from snarkjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.