Terminal stops running commands after switching Node's version with nvm - javascript

Hope to find you guys well =).
So, my problem is that I'm trying to initialize a Gatsby project and after some trouble I discovered that for some boiler plate "starter" template to work I would have to install an older version of Node. Since I already have nvm installed, I just downloaded the version I wanted and switched via terminal.
I verified it with node -v and it threw me the version I wanted. The thing is that when I try to run 'gatsby develop' it says "gatsby: command not found".
And that if I close and open my terminal again it resets the version. Is this supposed to behave like that?
By the way, you can already tell that I'm new at this so any information or guidelines will be of extreme helpfulness.

You can try doing yarn develop if using yarn. Or npx develop if using npx

Related

'run-s' is not recognized as an internal or external command, operable program or batch file

I surprisingly got that issue out of nowhere, when I was trying to use the npm link command testing my local package. Any thoughts?
Windows 10
node 15.9.0
npm 8.12.2
Seems that the issue was because my npm version didn't match my node version.
I was trying to install that 'run-s' package globally but it didn't help. I checked my environment variables but it didn't help either.
After all I just simply uninstalled nodejs, deleted all the files that it left and installed the needed version again (12.22.12 in my case) using "windows-nvm" and now everything runs smoothly.
Now my NodeJS version is 12.22.12
my NPM version is 6.14.16
Hope it will help somebody

Error when Installing dependencies on a React project (node)

Hello I am currently stuck with a task that is given to me. The problem is that I am unable to install dependencies when running npm install which means that I am unable to run the website locally which is my main goal
There are many versions of this question in the internet but I am not really sure what the main cause of this therefore the title of this question
you can view my error logs here
https://www.codepile.net/pile/4qL4NOq0
I have also tried some solutions that I have seen on the internet such as:
reinstalling node
deleting node_modules and package-lock.json and re-npm install (this is when I have installed the node_modules but still unable to run the website locally)
installing grpc globally
The version of grpc that you are installing (1.23.3) does not support the version of Node.js that you are using (16). You will need to use a newer version of grpc (the latest is 1.24.11) or an older version of Node to get that to work.
Please note that the grpc package has been deprecated in favor of the #grpc/grpc-js package. It is recommended that you use that one instead if possible.

The engine “node” is incompatible with this module when installing React-chartjs-2 Chart.js,

I am creating a doughnut chart by using chart.js with its react wrapper. It's working fine in the new project, but not able to install it in the main project.
Below is an example of a new project where it's working fine.
And below is the example of the main old project, where I am not able to install it
Error:
The engine “node” is incompatible with this module
Node version is the same, you can check in both images.
From the log, I can see that this is an issue with the version of the node you are currently having. See this line in your log
The engine "node" is incompatible with the module. Expected version ">=10". Got "8.10.0"
To solve this, you could try this
1. Install nvm
2. Download another version of node ">=10"
3. Switch to that the latest version
4. And try installing the module again
You need to upgrade your node version. As you are using husky v4, you need node >= 10.
Check husky installation guide and The engine “node” is incompatible with this module.
For anyone on Husky v7, and using VSCode:
VSCode can use a different shell to your standard one. In my case, it was using bash instead of zsh - which did not have nvm installed and therefore was not using the correct version of node.
Fix:
Open the Command Palette in VSCode - ⌘ + ⇧ + P
Type Terminal: Select Default Profile
Select the terminal that you have set up nvm or similar on.
Restart VSCode
🎉

Node installed but node cannot be found in Ubuntu VPS

I installed node via NVM. I installed node 0.10.32. using NVM 0.25.0
When I do node -v I get
-bash: /root/.nvm/v0.10.32/bin/node: No such file or directory
when I do npm v I get
/root/.nvm/v0.10.32/bin/npm: 2: exec: /root/.nvm/v0.10.32/bin/node: not found
All those directories exist and node executable is in it but they are reading as not found. Node seems to be installed but I am unable to use it. I am not sure how to fix this issue. Any ideas will be greatly appreciated
Check that your ~/.bash_profile has this:
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
https://github.com/creationix/nvm/issues/576
A lot of things can be wrong here from what you describe. Generally I don't recommend using nvm to install Node on servers. It works fine for your own work on a local machine but when you need to be sure what is installed and where, I recommend doing a real installation.
I recently wrote a tutorial on how to install Node on Linux:
https://gist.github.com/rsp/edf756a05b10f25ee305cc98a161876a
It is specifically about version 6.7.0 but just change the version number to use any other version of Node.
You can see other answers showing how to install Node properly and troubleshoot if it isn't installed correctly:
Run npm as superuser, it isn't a good idea?
node 5.5.0 already installed but node -v fetches with "v4.2.1" on OS X & homebrew?
Just get the binary or source package of the version that you need, install it where you want and it will work. The most reliable way is to install a source package because you can run make test before you install and because npm will have the correct shebang line (which may not always be the case with binary distribution - which, incidentally, is also used by nvm). No need to use nvm or any other tool to do that.
The nvm is great if you need to quickly switch Node versions during development on your local machine but if you want a reliable way to install Node on the server then it's best to install it normally.

Installing Node.js ./configure make sudo make install

I am currently trying to download node.js. I have downloaded everything and am now at the part where I enter the console commands.
What I am entering:
cd node
./configure
make
after entering ./configure, i get this error
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer director /Library/Developer/CommandLineTools' is a command line tools instance`
I'm not sure what this means. After entering make, i then get this repeated in a infinite loop in the console
http://pastebin.com/YrDs2Afw
in general it's a good rule of thumb to provide a bit information about what you already tried and on what system you are - especially when you are having issues with installing something.
I'll just assume, that you're working on a Mac.
I would recommend to download and install XCode as Quentin already recommended.
You can find it in the AppStore.
Once that done, make sure to install the "Command Line Tools" within XCode.
Now you have several options:
- Install Homebrew and install NodeJS from there (google Homebrew if you don't know what it is)
- Download and execute the Node v0.10.26.pkg (current version as of writing this), which will take care of the installation for you.
Hope this helps

Categories

Resources