truffle migrate fails to fetch solidity compiler though mac is connected to internet - npm

truffle migrate
Compiling your contracts...
Error: Failed to fetch the Solidity compiler from the following locations: https://relay.trufflesuite.com/solc/emscripten-wasm32/,https://binaries.soliditylang.org/emscripten-wasm32/,https://relay.trufflesuite.com/solc/emscripten-asmjs/,https://binaries.soliditylang.org/emscripten-asmjs/,https://solc-bin.ethereum.org/bin/,https://ethereum.github.io/solc-bin/bin/. Are you connected to the internet?
at VersionRange.<anonymous> (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/dist/compilerSupplier/loadingStrategies/VersionRange.js:183:1)
at Generator.next (<anonymous>)
at /usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/dist/compilerSupplier/loadingStrategies/VersionRange.js:8:1
at new Promise (<anonymous>)
at exports.modules.780.__awaiter (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/dist/compilerSupplier/loadingStrategies/VersionRange.js:4:1)
at VersionRange.getSolcFromCacheOrUrl (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/dist/compilerSupplier/loadingStrategies/VersionRange.js:174:1)
at VersionRange.<anonymous> (/usr/local/lib/node_modules/truffle/build/webpack:/packages/compile-solidity/dist/compilerSupplier/loadingStrategies/VersionRange.js:206:1)
I am unable to execute this command on my Macbook even though it is connected to internet without any active antivirus or proxy.
Expected that the contracts compiled successfully
My config:
Truffle v5.7.5 (core: 5.7.5)
Ganache v7.7.3
Solidity - 0.8.0 (solc-js)
Node v18.14.0
Web3.js v1.8.2

Related

Webdriver IO face with spec node found error above Node.js version 14

Description:
I can't trigger webdriver io test feature under node.js 16.
I have tried 14.20.0 worked for me, but face with element locating issue.
With node version below, all same issue happened:
v16.16.0
v18.12.1
v18.13.0
v19.4.0
And most unbelievable is that, same code code with same node and npm version on windows machine, all works good and pass.
I'm very confused about if the webdriver io is not supported on Mac or not.
Env:
1.Mac OS 12.6.2 (21G320)
2.Node version v16.16.0
3.Npm version 9.4.0
Error Log:
automationtests#1.0.0 Test
npx wdio run wdio.conf.ts
Execution of 0 workers started at 2023-02-07T05:43:36.724Z
Starting Cucumber Test
2023-02-07T05:43:38.278Z ERROR #wdio/cli:launcher: No specs found to run, exiting with failure
2023-02-07T05:43:38.332Z ERROR #wdio/cli:utils: Error in onCompleteHook: Error: There were issues reading JSON-files from '.tmp/json'.
at collectJSONS (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/multiple-cucumber-html-reporter/lib/collect-jsons.js:27:15)
at Object.generateReport [as generate] (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/multiple-cucumber-html-reporter/lib/generate-report.js:79:23)
at Object.onComplete (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/wdio.conf.ts:407:38)
at /Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/#wdio/cli/build/utils.js:99:19
at Array.map ()
at runOnCompleteHook (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/#wdio/cli/build/utils.js:97:39)
at Launcher.run (/Users/jjiang310/IdeaProjects/fc-ui-test-automation/node_modules/#wdio/cli/build/launcher.js:96:75)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Spec Files: 0 passed, 0 total (0% completed) in 00:00:01
I have tried different node version, and test the same code with same node and npm version run on Windows machine can all pass which can make sure there is no code level problem to make the test case failed.
I expected the code can run and pass on Mac machine same as the windows.

Truffle not able to get Solidity Compiler

jaypatel#192 Bridge Contract % truffle compile
Compiling your contracts...
Error: Failed to fetch the Solidity compiler from the following locations: https://relay.trufflesuite.com/solc/emscripten-wasm32/,https://binaries.soliditylang.org/emscripten-wasm32/,https://relay.trufflesuite.com/solc/emscripten-asmjs/,https://binaries.soliditylang.org/emscripten-asmjs/,https://solc-bin.ethereum.org/bin/,https://ethereum.github.io/solc-bin/bin/. Are you connected to the internet?
I am Compiling the contract using truffle compile but getting this error
This error means that Truffle cannot obtain the Solidity compiler from the specified sources. Possible reasons for this error:
You don't have an internet connection. Check that you have a network connection and try again.
The Solidity compiler is not installed. Make sure you have the latest compiler installed

Error: Cannot find module '#trufflesuite/bigint-buffer'

Unable to truffle migrate as it is showing - Error: Cannot find module '#trufflesuite/bigint-buffer'.
Even I tried the command npm install #trufflesuite/bigint-buffer

Getting Errors on running truffle command: Cannot find module '#truffle/db-loader'

I had several problems when downloading truffle -g. I had Error: EACCES: permission denied error. On my final attempt, I used sudo chown -R $USER /usr/local/lib/node_modules, and was able to download it successfully.
Issue
After downloaded Truffle, when I ran the command "truffle init" , I get an error that says command not found. Then I ran the command
"npx truffle init"
truffle inits successfully. But when I cd into my project folder and do "npx truffle init", I get an error
Error: Cannot find module '#truffle/db-loader'
Environment
Operating System: MacOS
Ethereum client:
Truffle version (truffle version): Truffle v5.5.25 (core: 5.5.25)
Ganache v7.4.0
node version (node --version): v16.15.1
npm version (npm --version): 8.11.0

Issues running truffle: command not found

I'm trying to deploy a Smart Contract, before that I need to run truffle compile but I get the error
bash: truffle: command not found
I've installed truffle with npm globally and locally, I tried these commands (worked for someone else in my course)
npm init
npm i truffle
./node_modules/.bin/truffle init
but when I run
npm i truffle
I get "unsupported architecture" amongst tons of other errors. all of these fixes are not working, how can I fix this problem from the root of it?
Also trying sudo:
sudo npm install -g truffle
does install it i guess but also gives the error:
truffle#5.4.14 postinstall /Users/khalidhamid/.npm-
global/lib/node_modules/truffle
> node ./scripts/postinstall.js
Error: EACCES: permission denied, open
'/Users/khalidhamid/Library/Preferences/truffle-
nodejs/config.json'
regardless, it still gives truffle: command not found
Is there any specific reason to install truffle using npm i truffle in your project? I mean, just install it globally and cd into your new directory and use truffle init to craft a new project. This way you can use truffle architecture to write your contracts and also use all available truffle commands. Also using truffle config file you can change the solidity compiler version according to your needs.