Skip to content

Cannot find module 'poseidon-lite' when npx hardhat test  #115

Open
@Alexander-Herranz

Description

@Alexander-Herranz

Node.JS installed (tried with v20.18.1, v22.12.0 and v23.5.0)
Chip Apple M3, 16GB memory and macOS Sonoma 14.5

I previously tried both:

export ZETO_NAME=Zeto_AnonEncNullifier
npx hardhat run scripts/deploy_upgradeable.js

and

export ZETO_NAME=Zeto_AnonEncNullifier
npx hardhat run scripts/deploy_cloneable.js

And when trying to execute tests, in both cases I got the same error about poseidon-lite

➜  solidity git:(main) npx hardhat test                               
An unexpected error occurred:

Error: Cannot find module 'poseidon-lite'

Require stack:

/zeto-lab/zeto/zkp/js/index.js
/zeto-lab/zeto/solidity/test/gas_cost/zeto_anon_enc_nullifier_kyc_cost_analysis.ts
/zeto-lab/zeto/solidity/node_modules/mocha/lib/mocha.js
/zeto-lab/zeto/solidity/node_modules/mocha/index.js
/zeto-lab/zeto/solidity/node_modules/hardhat/builtin-tasks/test.js
/zeto-lab/zeto/solidity/node_modules/hardhat/internal/core/tasks/builtin-tasks.js
/zeto-lab/zeto/solidity/node_modules/hardhat/internal/core/config/config-loading.js
/zeto-lab/zeto/solidity/node_modules/hardhat/internal/cli/cli.js
/zeto-lab/zeto/solidity/node_modules/hardhat/internal/cli/bootstrap.js
    at Function.<anonymous> (node:internal/modules/cjs/loader:1249:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/zeto-lab/zeto/solidity/node_modules/@cspotcode/source-map-support/source-map-support.js:811:30)
    at Function._load (node:internal/modules/cjs/loader:1075:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:219:24)
    at Module.require (node:internal/modules/cjs/loader:1340:12)
    at require (node:internal/modules/helpers:138:16)
    at Object.<anonymous> (/Users/alexander/Documents/Alexander/zeto-lab/zeto/zkp/js/index.js:19:18)
    at Module._compile (node:internal/modules/cjs/loader:1565:14)
    at node:internal/modules/cjs/loader:1708:10 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/zeto-lab/zeto/zkp/js/index.js',
    '/zeto-lab/zeto/solidity/test/gas_cost/zeto_anon_enc_nullifier_kyc_cost_analysis.ts',
    '/zeto-lab/zeto/solidity/node_modules/mocha/lib/mocha.js',
    '/zeto-lab/zeto/solidity/node_modules/mocha/index.js',
    '/zeto-lab/zeto/solidity/node_modules/hardhat/builtin-tasks/test.js',
    '/zeto-lab/zeto/solidity/node_modules/hardhat/internal/core/tasks/builtin-tasks.js',
    '/zeto-lab/zeto/solidity/node_modules/hardhat/internal/core/config/config-loading.js',
    '/zeto-lab/zeto/solidity/node_modules/hardhat/internal/cli/cli.js',
    '/zeto-lab/zeto/solidity/node_modules/hardhat/internal/cli/bootstrap.js'
  ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions