DenoDDeno
Powered by
v1rtlV
Deno•4y ago•
1 reply
v1rtl

could not find npm package for

I'm trying to make Hardhat CLI work with Deno but I stumbled upon this error which comes from Deno:

I initialized a new hh project
pnpx hardhat init
pnpx hardhat init
then installed hh as a deno binary:

➜ deno install -Afq npm:hardhat
➜ deno install -Afq npm:hardhat


and got this:

➜ HARDHAT_EXPERIMENTAL_ALLOW_NON_LOCAL_INSTALLATION=true hardhat --help
Error 'could not find npm package for 'file:///tmp/hh/node_modules/@nomicfoundation/hardhat-toolbox/dist/src/index.js'' contains boxed error of unknown type:
  "could not find npm package for 'file:///tmp/hh/node_modules/@nomicfoundation/hardhat-toolbox/dist/src/index.js'"
An unexpected error occurred:

Error: could not find npm package for 'file:///tmp/hh/node_modules/@nomicfoundation/hardhat-toolbox/dist/src/index.js'
    at Object.Module._extensions..js (internal:ext/node/02_require.js:766:28)
    at Module.load (internal:ext/node/02_require.js:658:34)
    at Function.Module._load (internal:ext/node/02_require.js:515:14)
    at Module.require (internal:ext/node/02_require.js:680:21)
    at require (internal:ext/node/02_require.js:820:18)
    at Object.<anonymous> (file:///tmp/hh/hardhat.config.js:1:253)
    at Object.<anonymous> (file:///tmp/hh/hardhat.config.js:8:4)
    at Module._compile (internal:ext/node/02_require.js:747:36)
    at Object.Module._extensions..js (internal:ext/node/02_require.js:780:12)
    at Module.load (internal:ext/node/02_require.js:658:34)
➜ HARDHAT_EXPERIMENTAL_ALLOW_NON_LOCAL_INSTALLATION=true hardhat --help
Error 'could not find npm package for 'file:///tmp/hh/node_modules/@nomicfoundation/hardhat-toolbox/dist/src/index.js'' contains boxed error of unknown type:
  "could not find npm package for 'file:///tmp/hh/node_modules/@nomicfoundation/hardhat-toolbox/dist/src/index.js'"
An unexpected error occurred:

Error: could not find npm package for 'file:///tmp/hh/node_modules/@nomicfoundation/hardhat-toolbox/dist/src/index.js'
    at Object.Module._extensions..js (internal:ext/node/02_require.js:766:28)
    at Module.load (internal:ext/node/02_require.js:658:34)
    at Function.Module._load (internal:ext/node/02_require.js:515:14)
    at Module.require (internal:ext/node/02_require.js:680:21)
    at require (internal:ext/node/02_require.js:820:18)
    at Object.<anonymous> (file:///tmp/hh/hardhat.config.js:1:253)
    at Object.<anonymous> (file:///tmp/hh/hardhat.config.js:8:4)
    at Module._compile (internal:ext/node/02_require.js:747:36)
    at Object.Module._extensions..js (internal:ext/node/02_require.js:780:12)
    at Module.load (internal:ext/node/02_require.js:658:34)


p.s. I use that flag cuz here: https://github.com/NomicFoundation/hardhat/blob/main/packages/hardhat-core/src/internal/cli/cli.ts#L175
GitHub
hardhat/cli.ts at main · NomicFoundation/hardhat
Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software. Get Solidity stack traces & console.log. - hardhat/cli.ts at main · NomicFoundation/hardhat
hardhat/cli.ts at main · NomicFoundation/hardhat
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Local npm package
RevadikeRRevadike / help
11mo ago
Could not find a matching package in the node_modules directory
underscoreUunderscore / help
2y ago