Comments (10)
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.
This looks like a windows problem..
from snarkjs.
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.
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.
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.
I am having the same problem
from snarkjs.
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.
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.
Using Node 14.15.0 npm install -g snarkjs@latest installs "correctly" but no node_modules or package.json are created
from snarkjs.
I believe this was fixed by #131 - please update to snarkjs 0.4.16 and try again.
from snarkjs.
Related Issues (20)
- Adding TON smart contract generator HOT 1
- Cannot read properties of undefined (reading 'fullProve') HOT 2
- If non-linear constraints = 0 ,Error: Scalar size does not match HOT 1
- Error when running snarkjs groth16 setup: ENOENT: no such file or directory, open 'proving_key.json' HOT 1
- Which MPC protocol are you using for ZKPs?
- Is it safe to use the pre-generated ptau files in this repo? HOT 1
- Some out-of-range proof values pass the verification
- Receiving "Proof commitments are not valid" when verifying simple groth16 circuit HOT 1
- snarkjs pot contribute with same file as input and ouput causes issue
- Using BLS12-381 curve to generate groth16 solidity verifier results in out of range error in solidity HOT 1
- RangeError: Too many elements passed to Promise.all HOT 2
- The javascript prover and verifier will succeed when using public inputs > field prime
- Zkeys fail to be verified right after generations with custom R1CS and witness HOT 1
- How to call `soliditycalldata` in ethereum smart contract runtime? HOT 1
- Proof valiadation not working with cirtcuit that works fine with circom tester HOT 1
- snarkjs.groth16.verify is not working if pubSignals is empty
- snarkjs.groth16.fullProve run locally fine but doesn't run correctly on cloud
- Where is generate_witness.json? HOT 1
- Generating just a witness in browser HOT 2
- is there a cpp implementation of trusted setup? js runs too slow for my circuits
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snarkjs.