That`s a great hint @gabba, thanks a lot!
Will experiment with this.
Amy,
your question and screenshot helped me install truffle on my MacBooc , Thank you!!
Hi Dora.
The truffle init has to be done in the project folder.
It looks like you have done âtruffle initâ in the Documents folder. Then you try to go to the ethereum-course-advanced.?
It looks like you try to enter the Helloworld folder, but that it cant find it. Can you confirm that you have created the Helloword folder?
You can try to do this:
In the âethereum-course-advancedâ folder, create a new folder called âHelloworldâ.
when inside the âHelloworldâ folder, you can try the âtruffle initâ command.
That should create the truffle files and folders.
tell us if it still doesnât work.
Good luck.
Ivo
Ivo,
Thank you for your quick response. Iâll fix my folder mess.
Hi @Dora
In addition to @ivga80 advise i ll recommend you to do first a
npm init
It will create your package.json file, after asking you few information about your project (you can just keep pressing enter).
Then
npm install [email protected]
Npm will add the truffle dependency to your node_modules,
The error message is showing up because npm doesnât find the package.json file.
Hey @ivga80, thanks for the recommendation. I am having a hard time installing this truffle on Windows 10. Got some errors because of the permission, like other users. Tried to install CMDer but Windows Protect prevents it from opening⌠canât go around that. Now trying to use Command Prompt so letâs see how this goes⌠Also tried in my MacBook but was another nightmare⌠After successfully installing truffle (without -g) tried to init but always got the message âcommand not found: truffleâ⌠lol. Thanks for any suggestions!
Hey Guys
I set up Ganache under Windows 10 and have running truffle on Ubuntu under WSL. Now, I tried to add my contract in Ganache and getting following error:
Unhandled Error:
Could not find ânodeâ. Node.js is required to be installed to link Truffle projects.
Check the project configuration or try restarting Ganache.
Is it possible to run Ganache GUI with contracts without node installed on Windows. I have nodejs on my WSL.
Hi @mx_krzak
If you have linked the truffle config of your project when you have started ganache it should work but you ll not have information about your contract in the contract page thatâs it.
You need to have node installed to see additional information but otherwise it ll work.
This issue could be because ganache gui doesnât find node in your PATH. I think @ivga80 could have more info about setting this up on windows.
I will have to do a google search and find out. I just run it all on Win10 or Mac OS.
Ivo
I think the behavior on WSL and windows native are the same no ? I didnât want to give you extra google search by tagging you eheh
I got this error on linux and it was ganache which was not able to find my environment variable
If you have linked the truffle config of your project when you have started ganache it should work but you ll not have information about your contract in the contract page thatâs it.
This is what I exactly miss. I thought my contract wonât work. Now I understand that I need nodejs on Windows for Ganache to display this additional info. Even if Iâam able to point PATH to \$wsl⌠for node it wonât work since it is linux version. I found there is ganache-cli I can use to have all tools besides Visual Studio on WSL. However it seems ganache-cli needs more effort on startup.
Personally i am using ganache-cli on linux, their is an issue with the last ganache gui version itâs not sending back the event so itâs better to use ganache-cli.
just do a npm install ganache-cli
in your project and to start it ganache-cli -d
is the easiest way to start. You can pimp this command with a lot of parameters when you will get use to it
Hi everyone and @filip,
in Lesson4 I was able to migrate and deploy my Helloworld contract successfully. The function .getMessage() is working as expected. The .setMessage() returns an error. Any suggestions why is that?
Hi @Dora
Their is an other error, in you truffle console before.
Instance has already been declared
My guess is you tried to declare two times the instance, the first time you assigned your deployed contract to instance
you didnât have the setMessage() .
The second time you tried to assign the deployed contract to instance, it fails because you need to use an other variable name, or just assigning to instance without the let
.
OK thanks for the hint. I succesfully started to use ganache-cli with truffle. However Iâam missing how to check ballance or contract details like gnanache for Windows allows. I reviewed options but I have no clue how to check them.
Hi @mx_krzak
You can use truffle console, define your environment in the truffle config file :
networks: {
development: {
host: "127.0.0.1",
port: 8545,
network_id: "*" // Match any network id
}
}
Then start truffle with truffle console --network development
In you truffle console use type this commands:
accounts = web3.eth.accounts
accounts.forEach(function(a){ console.log(a + " - " + web3.fromWei(web3.eth.getBalance(a), 'ether')) })
Edit: You can also import one of your private key into metamask to check your balance and sign transactions
Hi @filip!
I canât start truffle after installation. An Error occours that power shell can not find âtruffelâ
Do Iâve to set up a global variable? If yes, where is the src folder from truffle?
thanks daniel