**MacOS Ventura Truffle Installation Guide** #5118
Replies: 3 comments 8 replies
-
I still cannot get this to work. After I have the .zshrc file created. I have the code below and saved the file. When I run this command after nvm install --lts I get an error "bash: nvm: command not found" ... I have tried it with |
Beta Was this translation helpful? Give feedback.
-
I can't get this to build on MacOS:
I follow the instructions in the original posting, and I get the error messages, but don't seen any obvious error messages:
I tried to run the npm audit command:
I tried to just run truffle to see if it was installed.
However, I didn't run the installation command with the sudo, so this seems odd. Using the find command, I found the file 'truffle' in '/usr/local/bin/truffle'.
However, ../lib/node_modules/truffle does not exist:
Is this indicative of the build failing with nvm? If so, where can I find the actual error so I can further debug? |
Beta Was this translation helpful? Give feedback.
-
Hi,
Seems like you have a different python version installed on your machine and you are trying to run the code with higher python version.
1)You can upgrade your python version2) If the step 1 doesn't solve the issue check your node version if it's over 14.0.0 then downgrade it to 14 using nvm use 14
In a terminal:
nvm install 14
then
nvm use 14.19.3
then try installing truffle one more time
npm install -g truffle
On Saturday, 9 July, 2022 at 11:40:45 pm GMT-4, holywatr ***@***.***> wrote:
Hello ! I've been trying for hours to get Truffle onto my Mac OS Monterey, and have had zero luck. I'm brand new in the dev world so that might have something to do with it - but I'm hoping someone here can help me :/
I've downloaded Node / NPM / NVM ... done everything I've read to do - and yet I still receive erros.
So I type in:
npm i -g truffle
and it all goes smoothly up until:
npm WARN deprecated ***@***.***: This module has been superseded by the multiformats module
at which point, I start receiving erros that look like this:
npm ERR! code 1 npm ERR! path /Users/patrickmiddelthon/.nvm/versions/node/v18.5.0/lib/node_modules/truffle/node_modules/ganache/node_modules/leveldown npm ERR! command failed npm ERR! command sh -c node-gyp rebuild npm ERR! CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using ***@***.*** npm ERR! gyp info using ***@***.*** | darwin | x64 npm ERR! gyp info find Python using Python version 3.8.2 found at "/Library/Developer/CommandLineTools/usr/bin/python3" npm ERR! gyp http GET https://nodejs.org/download/release/v18.5.0/node-v18.5.0-headers.tar.gz npm ERR! gyp http 200 https://nodejs.org/download/release/v18.5.0/node-v18.5.0-headers.tar.gz npm ERR! gyp http GET https://nodejs.org/download/release/v18.5.0/SHASUMS256.txt npm ERR! gyp http 200 https://nodejs.org/download/release/v18.5.0/SHASUMS256.txt npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
And the list goes on, and on, and on :)
So, I have no idea what I'm looking at, or what to do - and I'm mentally exhausted from figuring all this out by myself haha YouTube sure helps a lot though. Can someone help me troubleshoot this please? All I want to do is install Truffle haha I want to create Dapps and bots and fun stuff to explore Web3 with !!
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
last tested: November 16, 2022
The steps below have been tested on:
macOS 13.0.1 (Ventura)
macOS 12.3.1 (Monterey)
macOS 10.15.7 (Catalina)
Requirements:
Node.js v14-v18 (NPM)
Step 1 - Install Node.js
To avoid permission errors when installing globally, Node.js (NPM) recommends installing Node.js with a Node version manager (NVM) on Mac and Linux Operating systems
Install a node version manager (NVM):
Open a new terminal (you can find terminal in finder->utilities), enter this command to install NVM:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Some users may encounter xcode-select developer tools error
Some users may come across an error message (see below) when attempting to install NVM. If you are able to install NVM successfully without an error message please skip to step 2.
To resolve this issue run this command in the same terminal:
xcode-select --install
A message may pop up about installing command line tools. Click install and continue installation.
Try to install NVM again in the terminal with the same command:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
** Step 2 - Complete the NVM installation**
After the NVM installation is complete, verify installation by closing the terminal and opening a new terminal session. Some users may encounter this error message:
nvm: command not found
Since macOS 10.15, the default shell is zsh and nvm will look for .zshrc to update, none is installed by default. Follow the steps below to resolve this issue.
Run this command in your terminal:
touch ~/.zshrc
Run the NVM install script again:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Verify installation by closing and reopening your terminal and test by entering this command:
nvm
Step 3 - install the latest Truffle compatible version of Node.js (NPM) in the terminal with:
nvm install 18
Verify that Npm is installed in your terminal with:
npm
It is good practice to run the
npm doctor
command after you set up your Node.js environment on your computer.Npm doctor checks your Npm installation if the requirements to manage your JavaScript packages are configured and installed correctly. Since we are using a compatible version of NPM to install truffle (Node 18 , Npm 8) Npm doctor may alert you that your Npm installation to needs an update. This is because Npm doctor always looks at the latest version of Npm version available. You can ignore this warning and continue onto installing Truffle in the next step.
Step 4 - Install Truffle in a new terminal with:
npm install -g truffle
You may see some warnings or conflicts, this is typical and should work normally as long as there are no errors.
Test the Truffle install with:
truffle version
Beta Was this translation helpful? Give feedback.
All reactions