Discuss Scratch

__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

DifferentDance8
Scratcher
1000+ posts

What happened to Node?

To run Node.js in macOS, you can use the Terminal application. Here are the steps to follow:

1. Open the Terminal application by pressing `Command + Space` and typing `Terminal`.
2. Type `node -v` and press `Enter` to check if Node.js is already installed on your system. If it is, you will see the version number of Node.js printed on the screen.
3. If Node.js is not installed, you can install it using a package manager like Homebrew. To install Homebrew, type `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` in the Terminal and press `Enter`. Follow the instructions on the screen to complete the installation.
4. Once Homebrew is installed, type `brew install node` in the Terminal and press `Enter`. This will install Node.js on your system.
5. To verify that Node.js is installed, type `node -v` in the Terminal and press `Enter`. You should see the version number of Node.js printed on the screen.

That's it! You can now run Node.js applications in macOS using the Terminal application.

If Node.js is already installed on your system, but running the `node` command results in an error, it could be due to a variety of reasons. Here are some possible solutions:

1. Check the installation: Verify that Node.js is installed correctly by running the `node -v` command in the Terminal. If it returns a version number, then Node.js is installed correctly.

2. Check the PATH environment variable: Ensure that the directory containing the `node` executable is included in your system's PATH environment variable. You can check this by running `echo $PATH` in the Terminal. If the directory containing `node` is not listed, you will need to add it to your PATH.

3. Reinstall Node.js: If neither of the above solutions work, you can try reinstalling Node.js. First, uninstall Node.js using a package manager like Homebrew or by deleting the Node.js directory manually. Then, reinstall Node.js using Homebrew or by downloading the installer from the official website.
__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

DifferentDance8 wrote:

1. Check the installation: Verify that Node.js is installed correctly by running the `node -v` command in the Terminal. If it returns a version number, then Node.js is installed correctly.
jfami@Macs-MacBook-Pro routes % node -v
zsh: command not found: node
jfami@Macs-MacBook-Pro routes %

DifferentDance8 wrote:

2. Check the PATH environment variable: Ensure that the directory containing the `node` executable is included in your system's PATH environment variable. You can check this by running `echo $PATH` in the Terminal. If the directory containing `node` is not listed, you will need to add it to your PATH.
jfami@Macs-MacBook-Pro routes % echo $PATH
/Users/jfami/anaconda3/condabin:/usr/local/mysql/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jfami/.cargo/bin
jfami@Macs-MacBook-Pro routes %
DifferentDance8
Scratcher
1000+ posts

What happened to Node?

__Falcon-Games__ wrote:

DifferentDance8 wrote:

2. Check the PATH environment variable: Ensure that the directory containing the `node` executable is included in your system's PATH environment variable. You can check this by running `echo $PATH` in the Terminal. If the directory containing `node` is not listed, you will need to add it to your PATH.
jfami@Macs-MacBook-Pro routes % echo $PATH
/Users/jfami/anaconda3/condabin:/usr/local/mysql/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jfami/.cargo/bin
jfami@Macs-MacBook-Pro routes %
To add the paths to the PATH environment variable in MacOS, you can follow these steps:

1. Open the Terminal app on your Mac.
2. Type the following command and press Enter: `nano ~/.bash_profile`
3. In the text editor that opens, add the following lines at the end of the file:
export PATH=$PATH:/path/to/nodejs
export PATH=$PATH:/path/to/npm/
4. Save the file by pressing `Ctrl+O`, then `Enter`.
5. Exit the text editor by pressing `Ctrl+X`.
6. To apply the changes, run the following command: `source ~/.bash_profile`

After following these steps, you should be able to use Node.JS and NPM from anywhere in your terminal window.
__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

DifferentDance8 wrote:

__Falcon-Games__ wrote:

DifferentDance8 wrote:

2. Check the PATH environment variable: Ensure that the directory containing the `node` executable is included in your system's PATH environment variable. You can check this by running `echo $PATH` in the Terminal. If the directory containing `node` is not listed, you will need to add it to your PATH.
jfami@Macs-MacBook-Pro routes % echo $PATH
/Users/jfami/anaconda3/condabin:/usr/local/mysql/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jfami/.cargo/bin
jfami@Macs-MacBook-Pro routes %
To add the paths to the PATH environment variable in MacOS, you can follow these steps:

1. Open the Terminal app on your Mac.
2. Type the following command and press Enter: `nano ~/.bash_profile`
3. In the text editor that opens, add the following lines at the end of the file:
export PATH=$PATH:/path/to/nodejs
export PATH=$PATH:/path/to/npm/
4. Save the file by pressing `Ctrl+O`, then `Enter`.
5. Exit the text editor by pressing `Ctrl+X`.
6. To apply the changes, run the following command: `source ~/.bash_profile`

After following these steps, you should be able to use Node.JS and NPM from anywhere in your terminal window.
This is not related to PATHs, it worked a few days ago but suddenly doesn't work anymore.
CST1229
Scratcher
1000+ posts

What happened to Node?

DifferentDance8 wrote:

(#2)
To run Node.js in macOS, you can use the Terminal application. Here are the steps to follow:

(snip)
is this chatgpt

Last edited by CST1229 (Oct. 6, 2023 15:48:10)

DifferentDance8
Scratcher
1000+ posts

What happened to Node?

CST1229 wrote:

DifferentDance8 wrote:

(#2)
To run Node.js in macOS, you can use the Terminal application. Here are the steps to follow:

(snip)
is this chatgpt
Yeah, but at least it's helpful
mybearworld
Scratcher
1000+ posts

What happened to Node?

__Falcon-Games__ wrote:

(#5)
This is not related to PATHs, it worked a few days ago but suddenly doesn't work anymore.
Node is not in your PATH, which means you won't be able to use Node. Can you look in whatever folder Mac apps mostly put their applications in to see if Node's still there?
ajskateboarder
Scratcher
1000+ posts

What happened to Node?

__Falcon-Games__ wrote:

This is not related to PATHs, it worked a few days ago but suddenly doesn't work anymore.
Try reinstalling Node

DifferentDance8 wrote:

(#2)
To run Node.js in macOS, you can use the Terminal application. Here are the steps to follow:

snip
Not to be rude, but you should probably answer questions yourself
__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

mybearworld wrote:

__Falcon-Games__ wrote:

(#5)
This is not related to PATHs, it worked a few days ago but suddenly doesn't work anymore.
Node is not in your PATH, which means you won't be able to use Node. Can you look in whatever folder Mac apps mostly put their applications in to see if Node's still there?
Node is in my path, I can confirm.
jfami@Macs-MacBook-Pro bin % ls
brew mkcert npm termdx
corepack node npx tree
jfami@Macs-MacBook-Pro bin %
MESYETI
Scratcher
100+ posts

What happened to Node?

__Falcon-Games__ wrote:

mybearworld wrote:

__Falcon-Games__ wrote:

(#5)
This is not related to PATHs, it worked a few days ago but suddenly doesn't work anymore.
Node is not in your PATH, which means you won't be able to use Node. Can you look in whatever folder Mac apps mostly put their applications in to see if Node's still there?
Node is in my path, I can confirm.
jfami@Macs-MacBook-Pro bin % ls
brew mkcert npm termdx
corepack node npx tree
jfami@Macs-MacBook-Pro bin %

but is that folder in your PATH variable
__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

MESYETI wrote:

__Falcon-Games__ wrote:

mybearworld wrote:

__Falcon-Games__ wrote:

(#5)
This is not related to PATHs, it worked a few days ago but suddenly doesn't work anymore.
Node is not in your PATH, which means you won't be able to use Node. Can you look in whatever folder Mac apps mostly put their applications in to see if Node's still there?
Node is in my path, I can confirm.
jfami@Macs-MacBook-Pro bin % ls
brew mkcert npm termdx
corepack node npx tree
jfami@Macs-MacBook-Pro bin %

but is that folder in your PATH variable
jfami@Macs-MacBook-Pro Desktop % echo $PATH | grep /usr/local/bin
/Users/jfami/anaconda3/condabin:/usr/local/mysql/bin:/Applications/Sublime Text.app/Contents/SharedSupport/bin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/jfami/.cargo/bin
jfami@Macs-MacBook-Pro Desktop %
Yes.
zaid1442011
Scratcher
500+ posts

What happened to Node?

Uninstall then reinstall it.
__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

zaid1442011 wrote:

Uninstall then reinstall it.
I have tried that, didn't work.
zaid1442011
Scratcher
500+ posts

What happened to Node?

__Falcon-Games__ wrote:

(#14)

zaid1442011 wrote:

Uninstall then reinstall it.
I have tried that, didn't work.
Also make sure to check the /users/<username>/library/, and the /Library for any node files.
__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

zaid1442011 wrote:

__Falcon-Games__ wrote:

(#14)

zaid1442011 wrote:

Uninstall then reinstall it.
I have tried that, didn't work.
Also make sure to check the /users/<username>/library/, and the /Library for any node files.
I did that but I haven't found any.
zaid1442011
Scratcher
500+ posts

What happened to Node?

__Falcon-Games__ wrote:

(#16)

zaid1442011 wrote:

__Falcon-Games__ wrote:

(#14)

zaid1442011 wrote:

Uninstall then reinstall it.
I have tried that, didn't work.
Also make sure to check the /users/<username>/library/, and the /Library for any node files.
I did that but I haven't found any.
Erase your mac Maybe try installing an older version.
__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

zaid1442011 wrote:

__Falcon-Games__ wrote:

(#16)

zaid1442011 wrote:

__Falcon-Games__ wrote:

(#14)

zaid1442011 wrote:

Uninstall then reinstall it.
I have tried that, didn't work.
Also make sure to check the /users/<username>/library/, and the /Library for any node files.
I did that but I haven't found any.
Erase your mac Maybe try installing an older version.
I was using Node 16 before I re-installed for Node 18 so I don't think that would work.
god286
Scratcher
1000+ posts

What happened to Node?

__Falcon-Games__ wrote:

mybearworld wrote:

__Falcon-Games__ wrote:

(#5)
This is not related to PATHs, it worked a few days ago but suddenly doesn't work anymore.
Node is not in your PATH, which means you won't be able to use Node. Can you look in whatever folder Mac apps mostly put their applications in to see if Node's still there?
Node is in my path, I can confirm.
jfami@Macs-MacBook-Pro bin % ls
brew mkcert npm termdx
corepack node npx tree
jfami@Macs-MacBook-Pro bin %
Can you tell which directory it is by running the `pwd` command, and can you tell what is the type of node by running `file node` in the directory?

You could try to install node with pnpm.

Last edited by god286 (Oct. 7, 2023 21:28:35)

__Falcon-Games__
Scratcher
1000+ posts

What happened to Node?

god286 wrote:

__Falcon-Games__ wrote:

mybearworld wrote:

__Falcon-Games__ wrote:

(#5)
This is not related to PATHs, it worked a few days ago but suddenly doesn't work anymore.
Node is not in your PATH, which means you won't be able to use Node. Can you look in whatever folder Mac apps mostly put their applications in to see if Node's still there?
Node is in my path, I can confirm.
jfami@Macs-MacBook-Pro bin % ls
brew mkcert npm termdx
corepack node npx tree
jfami@Macs-MacBook-Pro bin %
Can you tell which directory it is by running the `pwd` command, and can you tell what is the type of node by running `file node` in the directory?

You could try to install node with pnpm.
jfami@Macs-MacBook-Pro bin % pwd
/usr/local/bin
jfami@Macs-MacBook-Pro bin % file node
node: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
node (for architecture x86_64): Mach-O 64-bit executable x86_64
node (for architecture arm64): Mach-O 64-bit executable arm64
jfami@Macs-MacBook-Pro bin %

I don't think reinstalling will fix it because I did that before but I will try that.

Powered by DjangoBB