Lesson 5: ganache-cliFileNotFoundError: [Errno 2] No such file or directory: 'ganache-cli' #560
Replies: 2 comments
-
even when using venv and installing via npm, it still doesn't work. Please see below changed 6 packages, and audited 102 packages in 4s 2 packages are looking for funding 8 vulnerabilities (7 moderate, 1 high) To address issues that do not require attention, run: To address all issues (including breaking changes), run: Run |
Beta Was this translation helpful? Give feedback.
-
Hello @CrispyButter I would pretty much say that the yarn packages aren't added to the env variables so they are not recognized as commands. I recommend you to install npm using brew or nvm, use this link as reference. I hope this info, might help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Can anyone help me understand why ganache-cli is not found when trying to deploy a script? I have ganache cli and for hours haven't been able to get past the Filenotfounderror.
(source) Trell@Kentrells-MacBook-Pro demos % node --v
node: bad option: --v
(source) Trell@Kentrells-MacBook-Pro demos % node -v
v16.13.1
(source) Trell@Kentrells-MacBook-Pro demos % npm -v
8.1.2
(source) Trell@Kentrells-MacBook-Pro demos % python --version
Python 3.10.0
(source) Trell@Kentrells-MacBook-Pro demos % brownie
Brownie v1.16.4 - Python development framework for Ethereum
Usage: brownie [...] [options ]
Commands:
init Initialize a new brownie project
bake Initialize from a brownie-mix template
pm Install and manage external packages
compile Compile the contract source files
console Load the console
test Run test cases in the tests/ folder
run Run a script in the scripts/ folder
accounts Manage local accounts
networks Manage network settings
gui Load the GUI to view opcodes and test coverage
analyze Find security vulnerabilities using the MythX API
Options:
--help -h Display this message
--version Show version and exit
Type 'brownie --help' for specific options and more information about
each command.
(source) Trell@Kentrells-MacBook-Pro demos % ganache-cli --version
zsh: command not found: ganache-cli
(source) Trell@Kentrells-MacBook-Pro demos % yarn --version
1.22.17
(source) Trell@Kentrells-MacBook-Pro demos % yarn add ganache-cli
yarn add v1.22.17
warning package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning No license field
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
warning No license field
success Saved 4 new dependencies.
info Direct dependencies
└─ [email protected]
info All dependencies
├─ [email protected]
├─ [email protected]
├─ [email protected]
└─ [email protected]
✨ Done in 3.52s.
(source) Trell@Kentrells-MacBook-Pro demos % ganache-cli --version
zsh: command not found: ganache-cli
(source) Trell@Kentrells-MacBook-Pro demos % brownie run scripts/deploy.py
Brownie v1.16.4 - Python development framework for Ethereum
Launching 'ganache-cli --port 8545 --gasLimit 12000000 --accounts 10 --hardfork istanbul --mnemonic brownie'...
File "brownie/_cli/main.py", line 64, in main
importlib.import_module(f"brownie._cli.{cmd}").main()
File "brownie/_cli/run.py", line 43, in main
network.connect(CONFIG.argv["network"])
File "brownie/network/main.py", line 50, in connect
rpc.launch(active["cmd"], **active["cmd_settings"])
File "brownie/network/rpc/init.py", line 75, in launch
self.process = self.backend.launch(cmd, **kwargs)
File "brownie/network/rpc/ganache.py", line 73, in launch
return psutil.Popen(cmd_list, stdin=DEVNULL, stdout=out, stderr=out)
File "psutil/init.py", line 1312, in init
self.__subproc = subprocess.Popen(*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 966, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1842, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ganache-cli'
Beta Was this translation helpful? Give feedback.
All reactions