Hey @filip, I have windows 10 and have successfully installed truffle, but when I run “truffle init” it returns
" the term truffle is not recognized as the name of a cmdlet, function, script file, or operable program."
Just wondering if anyone can help me out.
How did you install truffle ?
I m not on windows but i can maybe help you.
I opened the Powershell as Administrator and used the command “npm install -g [email protected]”.
I saw someone had better success with cmder , so I tried it but ran into the same problem.
I just tried toto…in Helloworldtest.js
const Helloworld = artifacts.require("Helloworld");
contract("Helloworld", async function(){
it("should initialize correctly", async function(){
let toto = await Helloworld.deployed();
let message = await toto.getMessage();
assert(message === "Hello Again!"
, "Message should be Hello Again!");
});
});
and still received:
TypeError [ERR_INVALID_REPL_INPUT] [ERR_INVALID_REPL_INPUT]: Listeners for uncaughtException
cannot be used in the REPL
Try to install it locally instead of globally
run
npm init
in a new floder
then
npm i truffle
And test
./node_modules/.bin/truffle init
Let me know if you still have an error after that
I saw your truffle test on an other topic so i guess you solved it right ?
Yes, it works. The link in the course went to another forum I guess.
Does truffle migrate deploy the compiled version of sol file (build/contracts/HelloWorld.json) or does it compile the sol file and then deploys it?
EDIT: NEVERMIND. Just watched the next video and got my answer. Migrate compiles it and deploys it.
Compile just compiles it.
Hey @filip,
was trying to install Truffle on my iMac, when I went to install I received this error message…
MiAms-iMac:Documents iMac$ npm install -g [email protected]
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.)
Please Advise,
Thank you,
Michael L
Hi @filip,
I’m having problems installing Truffle on my Mac. I tried it with the -G, without the -G, and even with sudo in front. I get a bunch of errors every time.
I’m thinking there must be some additional setup needed prior to running the truffle command.
Without the -G seems to give the fewest errors:
Thanks,
Jeff
Those are just warnings, so it still was installed correctly. Both you and @Blockchain4MiAm should be able to proceed without issue
Thanks Filip!
I appreciate your work!
ML
Hey @filip
so it turns out that I got a bunch of errors. I tried to run truffle in my Helloworld folder however it said ‘command not found’.
Here is what my terminal said;
MiAms-iMac:advancedSolidityCourse iMac$ mkdir Helloworld
mkdir: Helloworld: File exists
MiAms-iMac:advancedSolidityCourse iMac$ cd Helloworld
MiAms-iMac:Helloworld iMac$ truffle init
-bash: truffle: command not found
MiAms-iMac:Helloworld iMac$ npm install -g [email protected]
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 checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR! stack: "Error: EACCES: permission denied, access '/usr/local/lib/node_modules'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
Hi @filip!
I changed the value and require so the migration could complete successfully, but I don’t see the word “Success” in the Terminal or in the Ganache logs. Where should “Success” be showing up?
Thanks,
Jeff
Your user is not allow to write in this directory
path /usr/local/lib/node_modules
try to install truffle locally instead of globally
npm install truffle@nodeLTS
It depends on your truffle version, mine doesn’t show “success” too, if it doesn’t show any errors it s fine
I am not sure whether Truffle installation is successful. This is the message I got when I ran the npm install command for truffle installation
PS C:\users\simpl\documents\blockchaintraining\programmingcourse\ethereum\helloworld> npm install -g [email protected]
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.)
C:\Users\simpl\AppData\Roaming\npm\truffle -> C:\Users\simpl\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js
[email protected] postinstall C:\Users\simpl\AppData\Roaming\npm\node_modules\truffle
node ./scripts/postinstall.js
- Fetching solc version list from solc-bin. Attempt #1
- [email protected]
updated 1 package in 43.872s
I am not able to run any truffle commands. How to change the execution policies? I am running Powershell as administrator on Windows
PS C:\users\simpl\documents\blockchaintraining\programmingcourse\ethereum\helloworld> truffle init
truffle : File C:\Users\simpl\AppData\Roaming\npm\truffle.ps1 cannot be loaded because running scripts is disabled on
this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
- truffle init
-
+ CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
I am not able to download ganache from github. Getting the message “Failed - Network error” towards the end.
It’s seems that the execution is successful because you are able to execute the command truffle init.
For the script issue you can try this in your powershell :
Set-ExecutionPolicy RemoteSigned
Which version of windows are you using ?
Mor info about your script issue here :
https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system