Truffle Introduction

@Su.kal.Crypto

pm ERR! notarget No matching version found for [email protected] this message is strange as I am able install that version. Just to double check make sure that you have not wrote a dot (.) after the number 12

sudo npm install -g [email protected]

If you are sure that the command is correct and still does not work, run sudo npm install -g truffle

Notice that you will receive warnings during the installation, that’s ok.

Once done run truffle -v you should see something like:

Cheers,
Dani

as you can see i tried in the documents folder - both
sudo npm install -g [email protected] (that you suggested)

and sudo npm install -g [email protected](that Fillip suggested)

but its still not working.

Then i tried again the below :

You don’t have access to this file.

at Object.openSync (fs.js:476:3)
at Object.readFileSync (fs.js:377:35)
at Configstore.get all [as all] (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/~/configstore/index.js:31:1)
at new Configstore (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/~/configstore/index.js:25:31)
at Function.getUserConfig (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:151:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:11:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop.js:2:22)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/index.js:9:12)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:33:29)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:65:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:71:10)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47

Error: Error while attempting to download and cache solc 0.5.8: Command failed: node ./build/cli.bundled.js obtain --solc=0.5.8
Error: EACCES: permission denied, open ‘/Users/aadyakalra/.config/truffle/config.json’
You don’t have access to this file.

at Object.openSync (fs.js:476:3)
at Object.readFileSync (fs.js:377:35)
at Configstore.get all [as all] (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/~/configstore/index.js:31:1)
at new Configstore (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/~/configstore/index.js:25:31)
at Function.getUserConfig (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:151:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:11:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop.js:2:22)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/index.js:9:12)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:33:29)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap d3abaec0ba5c4953076d:65:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:71:10)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47

at postinstallObtain (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/scripts/postinstall.js:13:11)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/scripts/postinstall.js:20:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
at internal/main/run_main_module.js:17:47
  • [email protected]
    updated 1 package in 7.486s
    aadyakalra@Aadyas-MacBook-Air Documents % cd /Users/aadyakalra/Documents/ethereum-course-advanced/Helloworld
    aadyakalra@Aadyas-MacBook-Air Helloworld % truffle init
    zsh: command not found: truffle

SO ITS STILL NOT WORKING

*PLEASE SUGGEST WHAT TO DO NEXT *

thanks and regards

Suveett Kalra

From what you shared truffle is installed.

[email protected]
updated 1 package in 7.486s

Try the following:

  • Reboot your pc, then try to run truffle init once again (do not skip this step).
    If that does not work:

  • Run sudo npm uninstall truffle -g

  • then follow this: FAQ - How to downgrade Node.Js

  • Reboot your pc.

  • Run sudo npm install -g truffle

  • Reboot

Try to use truffle again

Hello @dan-i

I did exactly as per the above instructions

Now its showing the following message:

Last login: Thu Dec 10 21:01:46 on ttys000

aadyakalra@Aadyas-MacBook-Air ~ % truffle init

zsh: command not found: truffle

aadyakalra@Aadyas-MacBook-Air ~ % cd /Users/aadyakalra/Documents/ethereum-course-advanced/Helloworld

aadyakalra@Aadyas-MacBook-Air Helloworld % truffle init

zsh: command not found: truffle

aadyakalra@Aadyas-MacBook-Air Helloworld % node -v

v10.21.0

aadyakalra@Aadyas-MacBook-Air Helloworld % nvm -v

zsh: command not found: nvm

aadyakalra@Aadyas-MacBook-Air Helloworld % npm -v

6.14.4

aadyakalra@Aadyas-MacBook-Air Helloworld %

Please let me know whats to be done now, as its still showing zsh: command not found : truffle

regards

suveett Kalra

Dear @dan-i

I tried to download the nvm through the links given on Forum, but my Mac doesn’t allow me to run/ install it :slight_smile:it shows the following message :slight_smile:
This download is from a developer we cannot verify as safe on running on this Mac

what could this be possibly ? I have absolutely no idea now how to navigate further …

i have literally tried everything now whats mentioned on the forum (and even read on google), but its still not working and i am literally tired now.
i am even following the exact instructions you gave me

thanks and regards

Suveett kalra

  • Reboot your pc, then try to run truffle init once again (do not skip this step).
    If that does not work:
  • Run sudo npm uninstall truffle -g
  • then follow this: FAQ - How to downgrade Node.Js
  • Reboot your pc.
  • Run sudo npm install -g truffle
  • Reboot

Try to use truffle again.

This below happened when i ran sudo install npm -g truffle

Last login: Thu Dec 10 21:15:39 on console
aadyakalra@Aadyas-MacBook-Air ~ % sudo npm install -g truffle
Password:
npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
/Users/aadyakalra/.npm-global/bin/truffle -> /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js

[email protected] postinstall /Users/aadyakalra/.npm-global/lib/node_modules/truffle
node ./scripts/postinstall.js

Error: EACCES: permission denied, open ‘/Users/aadyakalra/.config/truffle/config.json’
You don’t have access to this file.

at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Configstore.get all [as all] (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/node_modules/configstore/index.js:31:1)
at new Configstore (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/node_modules/configstore/index.js:25:31)
at Function.getUserConfig (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:171:1)
at Object.__awaiter (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:11:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop.js:2:22)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.defineProperty.value (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/index.js:9:12)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/commands.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.module.exports (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/external "./commands.bundled.js":1:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.module.exports (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:37:19)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

Error: Error while attempting to download and cache solc 0.5.16: Command failed: node ./build/cli.bundled.js obtain --solc=0.5.16
Error: EACCES: permission denied, open ‘/Users/aadyakalra/.config/truffle/config.json’
You don’t have access to this file.

at Object.openSync (fs.js:443:3)
at Object.readFileSync (fs.js:343:35)
at Configstore.get all [as all] (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/node_modules/configstore/index.js:31:1)
at new Configstore (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/node_modules/configstore/index.js:25:31)
at Function.getUserConfig (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/config/dist/index.js:171:1)
at Object.__awaiter (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:11:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop.js:2:22)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.defineProperty.value (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/index.js:9:12)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/commands.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.module.exports (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/external "./commands.bundled.js":1:1)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at Object.module.exports (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/packages/core/cli.js:37:19)
at __webpack_require__ (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:19:1)
at /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/webpack:/webpack/bootstrap:83:1
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js:89:10)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

at postinstallObtain (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/scripts/postinstall.js:13:11)
at Object.<anonymous> (/Users/aadyakalra/.npm-global/lib/node_modules/truffle/scripts/postinstall.js:20:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
  • [email protected]
    added 144 packages from 66 contributors in 18.866s
    aadyakalra@Aadyas-MacBook-Air ~ %

Then i rebooted and ran truffle init again :

as per the below :slight_smile:

I did exactly as per the above instructions

Now its showing the following message:

Last login: Thu Dec 10 21:01:46 on ttys000

aadyakalra@Aadyas-MacBook-Air ~ % truffle init

zsh: command not found: truffle

aadyakalra@Aadyas-MacBook-Air ~ % cd /Users/aadyakalra/Documents/ethereum-course-advanced/Helloworld

aadyakalra@Aadyas-MacBook-Air Helloworld % truffle init

zsh: command not found: truffle

so you see i am doing exactly as you advised me, but its not working

Please suggest

Also,

Hello @dan-i, @gabba, @filip

Please see the trailing messages. I really need to resolve this as today is the third day and i am unable to continue with my Course because of this Rare Technical issue.

I have been waiting since yesterday for a response.

If you will see from the above message at Terminal after running all commands exactly as per the Instructions of @dan-i , that i am still not able to initiate Truffle.
it gives the below message:

npm WARN deprecated [email protected]: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
/Users/aadyakalra/.npm-global/bin/truffle -> /Users/aadyakalra/.npm-global/lib/node_modules/truffle/build/cli.bundled.js

so when i click on this link (https://github.com/visionmedia/debug/issues/797)
i am directed to the below page. Unfortunately i am not so technical to really understand what exactly are the next steps to be taken now.

Kindly see below : :point_down: and Help

Hello. You’re probably here from the deprecation notice.

tl;dr This is a low-severity regression that was fixed but later re-introduced a while back. You are only affected if you pass un-sanitized, long user input to debug(ns)(...) - specifically, by way of the %o formatter - in Node.js. All other cases are unaffected.

Affected version selector: debug@>=3.2.0 <3.2.7 || >=4 <4.3.1

If you’re still pulling old versions of the package, please nuke your node_modules/npm cache. If you’re still pulling old versions of the package, bring it up with npm - I’ve confirmed everything is released and tagged correctly.

If the latest versions have introduced a bug for you (they shouldn’t), and you’ve confirmed you’ve not accidentally pulled a major version change based on your package.json version selector (e.g. don’t be using debug@* as I won’t support you), then please open a ticket on this repository.

Any questions or comments about the vulnerability itself can be left in this issue . Spam comments will be deleted as I expect this issue to see a lot of traffic.

Several years ago we were alerted to a ReDos vulnerable regex expression that was fixed in f53962e but was accidentally re-introduced in 7116906. The original CVE was assigned identifier CVE-2017-16137. There will not be a formal update nor will there be a second CVE identifier assigned to the regression. Maintainers of advisory databases are free to update the recommended versions to 3.2.7 or 4.3.1 and link to this issue as a regression advisory.

The regression was responsibly disclosed to me by Yaniv Nizry from the CxSCA AppSec team at Checkmarx via email. A fix was issued appx. 1 week ago and the public disclosure was set to go out no sooner than 7 days after that.

NPM has been notified but has not yet responded.

I realize this is a low-severity issue that doesn’t affect many people, but given that debug has >86 million weekly downloads and used (publicly) by >9 million repositories, I wanted to treat this as equally as any other security vulnerability. Apologies if the response seems a bit overdone, but I have learned not to assume how people are using this package because people continually surprise me throughout the years.

Thank you to Yaniv, and thank you, reader, for your patience.

  • Josh

thanks and regards

suveett kalra

I went to youtube to see if I can get a better understanding of truffle and the first video I click on is by @filip :smile:

1 Like

Hello, I am on Windows. I installed Truffle and Ganache then restarted my pc but when I run truffle init I get the following error (image below).

I tried the following which solved the error

1 Like

Check your DM, I want to troubleshoot this one in chat with you :slight_smile:

Have a nice day

su.kal crypto #5233

This is my Username on Discord.

I have sent you a Request on discord, Kindly accept and let’s take it over after 5 minutes … I will have my laptop ready. Also, let me know if you need some App like Teamviewer installed so you can have access to my Mac.
Cheers

Suveett Kalra

Hey @dan-i, Kindly lets make it now because i have a meeting plugged at 4 pm Indian standard time (thats 45 minutes from now), so it will be great to resolve it right now.

Thanks and Regards

Suveett kalra

In the console when I call getMessage() I get the message but when I call setMessage() I get this error. How to solve this ?

Also I get this error. What’s this error about?

For the community, that was a bug with Truffle.

Fixed with these steps:

  1. run npm init and make a new npm project
  2. run npm i truffle
  3. run ./node_modules/.bin/truffle init and it should work!

Source: https://stackoverflow.com/questions/38148521/truffle-command-not-found-after-installation

Hey @oneworldcoder

From your screenshot it seems like you don’t have a function setMessage.

Screenshot 2020-12-14 at 11.39.30

Can you share your contract?

1 Like

Hi @dan-i

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 {
    message = newMessage;
  }
}                                                       

In the console type:

let i = await HelloWorld.deployed()

then

i.setMessage("new message")

If that does not work

console.log(i)

and send me the screenshot

1 Like

Hi @dan-i

It worked! Please can you tell me what went wrong the first time?

Thank you

1 Like

It worked! Please can you tell me what went wrong the first time?

Hard to say because I don’t know what you did before :smiley:

What I sent you are just the normal steps to follow.

1 Like

Hi

I installed sudo npm -g [email protected] with the help of @dan-i, on my Mac.
the interesting or troublesome part of using sudo install is that we cannot run truffle command directly on our path where truffle is initialized, everytime we have to run like this below

./node_modules/.bin/truffle init
./node_modules/.bin/truffle compile
./node_modules/.bin/truffle migrate
./node_modules/.bin/truffle migrate --reset
./node_modules/.bin/truffle console

all the above commands run fine , except that when i am running
./node_modules/.bin/truffle migrate --reset

after my @_Helloworld_deploy.js file has been changed to the below code as per Filip’s lesson:

const Helloworld = artifacts.require(“Helloworld”);

module.exports = function (deployer) {
deployer.deploy(Helloworld).then(function(instance){
instance.setMessage(“Hello again !”).then(function(){
instance.getMessage().then(function(){
console.log(“Current Message :” + message);
});
});
});
};

I don’t get to see the new instance
Current message : “Hello again”
(Like in Filip’s video)

instead, it just points me to truffle(ganache) >
and asks me for further commands

and then when i type ./node_modules/.bin/truffle console i don’t get anything, maybe because i am already inside the ganache interactions.
My question is : How do i see that my Contract has automatically transacted with the Blockchain and my new message instance is ‘Hello again’

I even tried console.log(instance) but is shows undefined.
and if i try to define the instance as follows

let instance = await Helloworld.deployed()
then i have to again define the instance.setmessage() before i get a new message in instance.getMessage() which is similar to the setMessage() i defined in the Terminal.

so how do i know to know the final instance of my 2_Helloworld_deploy.js file on my Terminal ?

i have tried many options, but not working

Please help because i was left with no option but to install npm using " sudo npm install -g truffle command" because npm install -g [email protected] was just not working , and after using sudo install you just cannot follow all of Filip’s video and his commands in actuality.
You have to apply your own brains and creativity, which can be challenging for non programmers like, although i find it exciting :grinning:

Hey. @filip ey. @fili
It does not quite work for me (Working on a macbook pro 2020) I have installed truffle. But, it did not seem so removed -g too globally - When I saw others have done it. (See screenshot) But then when I try to write “truffle init” it just comes up: The file does not exist … Is there anyone who can help me?Skærmbillede 2020-12-15 kl. 11.21.53