How do I downgrade the node?
Same problems on linux
solved it by installing NVM and changed NODE.JS V12.18.1 ==> V10.18
then it worked
Hello,
I had error ERR_INVALID_REPL_INPUT after running test
so I followed these instructions.
After that I have a new error:
Compiling your contracts...
===========================
Error: TypeError: Error parsing C:/Users/enrico/Desktop/coding/truffle/helloworld/contracts/Migrations.sol: Cannot destructure property 'body' of 'undefined' as it is undefined.
at Object.compile (C:\Users\enrico\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\workflow-compile\legacy\index.js:80:1)
The Helloworld contract was not modified (before it was migrating it normally).
Do you have any idea how to fix this? thanks
Trying to run “test” in truffle console. Getting this message:
TypeError [ERR_INVALID_REPL_INPUT]: Listeners for uncaughtException
cannot be used in the REPL
Any advice?
I found this thread which I think is about this issue, but not sure what to do: https://github.com/trufflesuite/truffle/issues/2463
Hey @enrico
Check this FAQ: FAQ - How to downgrade Node.Js
Let me know if that fixes the issue.
Cheers,
Dani
Slavenr’s solution worked for me!
I had to downgrade node js from 12 to 10.16.0.
Here’s the link on how to change versions if your’e on a Mac.
https://stackoverflow.com/questions/47008159/how-to-downgrade-node-version
Can anyone help me with this error when i run the test?
helloworld.sol
pragma solidity 0.5.12;
contract Helloworld {
string message = "Hello World!";
function getMessage() public view returns (string memory) {
return message;
}
function setMessage(string memory newMessage) public payable {
message = message;
}
}
//Helloworld_Deploy.js
const Helloworld = artifacts.require("Helloworld");
module.exports = function(deployer, network, accounts){
deployer.deploy(Helloworld).then(function(instance){
instance.setMessage("Hello Again!", {value: 1000000, from: accounts[0]}).then(function(){
console.log("Success");
}).catch(function(err){
console.log("error: " + err);
});
}).catch(function(err){
console.log("Deploy failed " + err);
});
};
//initial migration
const Migrations = artifacts.require("Migrations");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};
//Helloworld.js
const Helloworld = artifacts.require("Helloworld");
contract("Helloworld", async function(){
it("should initialize correctly", async function(){
let instance = await Helloworld.deployed();
let message = await instance.getMessage();
assert(message === "Hello Again!");
});
});
Not sure if i can go further until i figure this error out.
Thanks chaps.
Rob.
Hey @Rob_McCourt
You have a warning and an error:
warning:
The parameter string memory message
is not used and can be removed.
error
This is related to the Node version installed.
Click this link and follow the guide to downgrade it:
https://forum.ivanontech.com/t/faq-how-to-downgrade-node-js/22908/2
let me know,
Dani
works perfectly thanks…
Could somebody please tell me what’s going on here? I don’t understand the error. I’ve looked over and over again at the code from the video and I cannot figure out what’s wrong. Thank you.
What was the last command?
Hey @mburtonshaw
From your screenshot it seems the tx failed due to a revert statement.
I am not able to provide more info as I need a bit of context.
Which function were you calling?
Also as @Rob_McCourt suggested, what was the last command you sent?
Cheers,
Dani
@Rob_McCourt @dan-i
I entered “truffle console” and then “test”. I may have entered “migrate” before “test” but I don’t think I did
hey @kryptokrymmenos
Please follow this faq and downgrade node js: FAQ - How to downgrade Node.Js
cheers,
Dani
Would you please share your github repo? I would like to take a look.
thanks
Dani