- 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
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 : 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.
thanks and regards
suveett kalra