Learning Truffle

i am having that problem too. i tryed looking it on google but couldnt find anythingā€¦
I have now copied the code on the migrations file and tried to migrate on the terminal but i still get the error. I think its because the constructor isnt defined??`Deploying ā€˜Walletā€™

Error: *** Deployment Failed ***

ā€œWalletā€ ā€“ Invalid number of parameters for ā€œundefinedā€. Got 0 expected 2!.

at C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\deployer\src\deployment.js:365:1
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at Migration._deploy (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:75:1)
at Migration._load (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:61:1)
at Migration.run (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\Migration.js:218:1)
at Object.runMigrations (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:150:1)
at Object.runFrom (C:\Users\alexp\AppData\Roaming\npm\node_modules\truffle\build\webpack:\packages\migrate\index.js:110:1)

`

Probably, console said ā€œWalletā€ ā€“ Invalid number of parameters for ā€œundefinedā€. Got 0 expected 2!. :nerd_face:

Carlos Z

Hello everyone,

Iā€™ve been having some issues with installing truffle. Iā€™ve tried the following methods.

  • Uninstall Truffle
  • Reinstall Truffle
  • Uninstall Truffle
  • Reinstall --force
  • sudo (which was not recognized as an internal or external command.)

Help would be much appreciated. Thanks.

Microsoft Windows [Version 10.0.19043.1110]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Lili>npm install -g truffle
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nWe recommend you to migrate to scoped packages.\nCheck out https://www.graphql-tools.com for more information
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: stable api reached
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nWe recommend you to migrate to scoped packages.\nCheck out https://www.graphql-tools.com for more information
npm WARN deprecated [email protected]: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
npm WARN deprecated [email protected]: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated [email protected]: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Package moved to @redux-devtools/instrument.
npm WARN deprecated [email protected]: Package moved to @redux-devtools/app.
npm WARN deprecated [email protected]: Package moved to @redux-devtools/serialize.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
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)
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
C:\Users\Lili\AppData\Roaming\npm\truffle -> C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js

> [email protected] install C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-win32-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:326:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:338:5)
gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:467:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:82:21)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lili\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Lili\\AppData\\Roaming\\npm\\node_modules\\truffle\\node_modules\\sqlite3\\lib\\binding\\node-v83-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\Users\\Lili\\AppData\\Roaming\\npm\\node_modules\\truffle\\node_modules\\sqlite3\\lib\\binding\\node-v83-win32-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3
gyp ERR! node -v v14.17.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:375:28)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1055:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.19043
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Lili\\AppData\\Roaming\\npm\\node_modules\\truffle\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3
node-pre-gyp ERR! node -v v14.17.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Lili\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)

> [email protected] postinstall C:\Users\Lili\AppData\Roaming\npm\node_modules\truffle
> node ./scripts/postinstall.js

- Fetching solc version list from solc-bin. Attempt #1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @zondax/filecoin-signing-tools@github:Digital-MOB-Filecoin/filecoin-signing-tools-js (node_modules\truffle\node_modules\filecoin.js\node_modules\@zondax\filecoin-signing-tools):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: Error while executing:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: undefined ls-remote -h -t ssh://[email protected]/Digital-MOB-Filecoin/filecoin-signing-tools-js.git
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: spawn git ENOENT
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\truffle\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\truffle\node_modules\sqlite3):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

+ [email protected]
added 8 packages from 11 contributors and updated 1 package in 686.217s

C:\Users\Lili>npm uninstall -g truffle
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nWe recommend you to migrate to scoped packages.\nCheck out https://www.graphql-tools.com for more information
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: stable api reached
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: This package has been deprecated and now it only exports makeExecutableSchema.\nWe recommend you to migrate to scoped packages.\nCheck out https://www.graphql-tools.com for more information
npm WARN deprecated [email protected]: The functionality provided by the `apollo-cache-control` package is built in to `apollo-server-core` starting with Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#cachecontrol for details.
npm WARN deprecated [email protected]: The `graphql-extensions` API has been removed from Apollo Server 3. Use the plugin API instead: https://www.apollographql.com/docs/apollo-server/integrations/plugins/
npm WARN deprecated [email protected]: The `apollo-tracing` package is no longer part of Apollo Server 3. See https://www.apollographql.com/docs/apollo-server/migration/#tracing for details
npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @zondax/filecoin-signing-tools@github:Digital-MOB-Filecoin/filecoin-signing-tools-js (node_modules\filecoin.js\node_modules\@zondax\filecoin-signing-tools):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: Error while executing:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: undefined ls-remote -h -t ssh://[email protected]/Digital-MOB-Filecoin/filecoin-signing-tools-js.git
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY:
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: spawn git ENOENT
npm WARN @graphql-tools/[email protected] requires a peer of graphql@^14.0.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @graphql-tools/[email protected] requires a peer of graphql@^14.0.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @graphql-tools/[email protected] requires a peer of graphql@^14.0.0 || ^15.0.0 but none is installed. You must install peer dependencies yourself.

removed 1688 packages and moved 35 packages in 616.605s

how do i define it??
isnt it already defined?
I have the same code you putā€¦

const Wallet = artifacts.require("Wallet");

module.exports = function(deployer, network, accounts) {
    // [multisig constructor] 
    // Should initialize the owners list and the limit 
    // constructor(address[] memory _owners, uint _limit) {
    //     owners = _owners;
    //     limit = _limit;
    // }
    const accountArray = [accounts[0], accounts[1], accounts[2]] 

    deployer.deploy(
      Wallet,
      accountArray, // this is _owners Array
      2 // this is _limit
    );
};

From your logs I can see that one error is You need to install the latest version of Python.
So letā€™s install it.
Go here and install Python: https://www.python.org/downloads/windows/

Then run again the truffle installation command. Sudo is a command for bash terminal, you are in windows therefore you should open the prompt as administrator (right click on it).
Then npm i -g truffle

Please share your code in the following way so we can review it :face_with_monocle:

Carlos Z

2 Likes

got it, it was just that i didnt save the code you gave me, so obviously the constructor wasnt defined.

Hi again, I am doing the ERC20 coding and when i compile i get this error witch says that the import statement for the openzeppelin is not found but i have it on the folder and i dont know what is the problem. could you help me out??

Compiling your contracts...
===========================
> Compiling .\contracts\Migrations.sol
> Compiling .\contracts\NewToken.sol

/C/Users/alexp/Desktop/alex/truffel/ERC20 token/contracts/NewToken.sol:1:1: ParserError: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note tha
t nightly builds are considered to be strictly less than the released version
pragma solidity ^0.8.0;
^---------------------^

Error: Truffle is currently using solc 0.5.16, but one or more of your contracts specify "pragma solidity ^0.8.0".

Please update your truffle config or pragma statement(s).
(See https://trufflesuite.com/docs/truffle/reference/configuration#compiler-configuration for information on
configuring Truffle to use a specific solc compiler version.)

Compilation failed. See above.

truffle(develop)> compile

Compiling your contracts...
===========================
ifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> /C/Users/alexp/Desktop/alex/truffel/ERC20 token/contracts/NewToken.sol


ParserError: Source "/C/Users/alexp/Desktop/alex/truffel/ERC20 token/node_modules/@OpenZeppelin/contras/token/ERC20/ERC20.sol" not found
 --> /C/Users/alexp/Desktop/alex/truffel/ERC20 token/contracts/NewToken.sol:3:1:
  |
3 | import "../node_modules/@OpenZeppelin/contras/token/ERC20/ERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Compilation failed. See above.
- Fetching solc version list from solc-bin. Attempt #1
- Fetching solc version list from solc-bin. Attempt #1

Here it is in the folder, hope you can see the folder path in the pic.
image

Did you modify the compiler version in your truffle config?

image

Carlos Z

A quick question. In order to deploy the multisig wallet in truffle we need to pass the constructor data for the wallet owners.
I did some research but didnĀ“t find any solution that would let me do it directly using truffle.
So my question would beā€¦ Is it possible to add these parameters without hardcoding them? and is it possible to deploy this contract without making changes to the 3_wallet_migration.js file?

const Wallet = artifacts.require("Wallet");

module.exports = function(deployer) {
  deployer.deploy(Wallet);
};

Hey @pieczyslaw, hope you are well.

Take a look at these post and those below it, we already discuss that subject this last week with another student :nerd_face:

Carlos Z

1 Like

this is what i get nowā€¦

ParserError: Source "/C/Users/alexp/Desktop/alex/truffel/ERC20 token/node_modules/@OpenZeppelin/contras/token/ERC20/ERC20.sol" not found

 --> /C/Users/alexp/Desktop/alex/truffel/ERC20 token/contracts/NewToken.sol:3:1:
  |
3 | import "../node_modules/@OpenZeppelin/contras/token/ERC20/ERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Compilation failed. See above.
- Fetching solc version list from solc-bin. Attempt #1
- Fetching solc version list from solc-bin. Attempt #1
1 Like

yes i did, i have it on the same version as the ERC20.sol file

1 Like

Is there a way to get access to specific tokens when running tests on development network? Like unlocking pre existing ERC20 contracts

1 Like

You have misspell the contract word, check the path :eyes:

Carlos Z

1 Like

Not exactly for local blockchains, unless you fork the mainnet and work from there, hardhat have some nice options for it.

Carlos Z

I use Moralis nodes to fork polygon. Want to test how my contract interacts with other contracts which are already deployed. Get some tokens and for example add liquidity on Uniswap and store LP tokens, but not sure if these things are possible, or is there some workaround to test these kind of contracts?

That case, is better to use a testnet, kovan, rinkeby, ropstenā€¦ any testnet that have the contract deployed in it. For example, IF uniswap have a contract deployed in the kovan testnet, you can deploy your contract in this one, using the address for the uniswap contract and you should be able to do your tests properly.

Carlos Z

1 Like

Alright, thanks for the tip, Iā€™ll go that route instead

Hey guys, Iā€™m doing the solidity smart contract 201 and following Philipā€™s steps, but iā€™m getting an error when I try to call a contract function from the cmd on Visual Studio Code.
I can compile and migrate the code with no problems, but when I try to call some function it throw errors.

truffle(develop)> let instance = await helloWorld.deployed()
Uncaught ReferenceError: global is not defined
    at evalmachine.<anonymous>:2:19

This is the error that I get when I try to get the ā€œinstanceā€ (it should return ā€œundifinedā€)

truffle(develop)> let instance = helloWorld.deployed()
undefined

But if i create the variable without the ā€œawaitā€ it return what it should return, but when i try to call some function this error is thown:

truffle(develop)> instance.hello()
evalmachine.<anonymous>:0
instance.hello()
         ^

Uncaught TypeError: instance.hello is not a function
    at evalmachine.<anonymous>
    at sigintHandlersWrap (node:vm:268:12)
    at Script.runInContext (node:vm:137:14)
.
.
.

(This is my contract)

pragma solidity 0.8.6;

contract helloWorld {
    string message = "Hello World";

    function setMessage(string memory newMessage) public payable returns (string memory){
        message = newMessage;
    }
    function hello() public pure returns (string memory){
        return "Hello world";
    }
}