zsh: command not found: netlify on mac OS - reactjs

I am trying to deploy basic react-app to netlify. I ran these commands to install and deploy application
npm install netlify-cli -g
netlify deploy
It throws:
zsh: command not found: netlify error.
I am working on mac OS. What is causing this issue?

It basically means your zshrc does not have npm binary directory in the PATH. Make sure that you have that squared away.
Are you using brew or nvm to install npm?
Correction
You have to install netlify-cli as well. That gives you the netlify command.
npm install -g netlify-cli

Go to folder:
/Users/<user>/.npm-global/lib/node_modules/
And delete any files/folders pertaining to Netlify. For exmaple folder named:
netlify-cli
Then reinstall the cli using
npm install netlify-cli -g

try this:
step 1: re-run the netlify-cli installation command to get the path where cli is installed
step 2: test the version using the full path where the cli is installed, it'll confirm that netlify-cli is working
step 3: add the npm directory link to your zsh environment variable PATH

Use the main Terminal(not the integrated terminal of your text editor) when installing the netlify-cli.
npm install -g netlify-cli
I had installed it multiple times in the integrated terminal of VS code but all in vain.Success came after using the Terminal.

Related

Error Trying to Install React on Windows 10

I'm trying to install react on windows 10 using npm install -g create-react-app.
The install fails and I get the following error message:
Error: EINVAL: invalid argument, mkdir 'C:\Program Files\Git\'C:\Users\User\AppData\Roaming\npm''
I should mention that I installed nodejs version 12.16.3 LTS on my windows machine right before I got this error.
Does anyone know why this is, or if there's a solution to this problem?
Please help!
First of all you are not trying to install react. You are trying to install create-react-app terminal tool. With that tool you can easily create react projects.
Let's do some checks first.
# Remove if you have installed it before
npm uninstall -g create-react-app
# Check if you have installed 'git' (if not install git)
git --version
# Check node.js (if not install node.js)
node --version
# Check npm (if not install npm)
npm --version
If they are all installed, now you can start installing create-react-app. I am not windows user but i would suggest you to use powershell. On linux i would use sudo command for this install.
# install create-react-app
npm install -g create-react-app
# check if it is installed
create-react-app --version

How can I open react-devtools?

I am trying to install and run react-devtools. I am following this guide to do that: https://github.com/facebook/react-devtools/blob/master/packages/react-devtools/README.md
The install seems to go ok:
To verify it installed correctly I do this command:
And I go to that directory and verify there is a folder called react-devtools.
To open the tools the docs indicate I should do this:
Back in my project directory I run this command:
And it says command not found. So it looks like I have installed the devtools, but I am unable to open them. What am I doing wrong?
Maybe this is what you want
Fix not run react-devtools
Option 1:
npm uninstall -g react-devtools
npm uninstall -g electron
npm install -g --verbose react-devtools
Option 2: (Fix in Linux, MacOSX)
sudo npm install -g react-devtools --unsafe-perm=true
Refer: react-devtools-command-not-found
if you want to run project level only do the following steps
Install using yarn add --dev react-devtools
Run yarn run react-devtools
To run react-devtools you can run either of the following commands depending on your package manager.
If using yarn:
yarn run react-devtools
If using npm:
npm run react-devtools
The real problem here is you are not giving "super user" permissions for the node package manager for installing the "react-devtools" globally.
Try this command it will fix your problem
sudo npm install -g react-devtools
When ignore the -g parameter in the command npm will install the react-devtools in directory that you currently working in. In your case the home directory.

create-react-app command not found in ubuntu 16.04 LTS

I tried to install create react app using sudo npm install -g create-react-app on my terminal, then this message appeared:
/home/mahi/.npm-global/bin/create-react-app -> /home/mahi/.npm-global/lib/node_modules/create-react-app/index.js
+ create-react-app#1.4.3
updated 1 package in 11.7s
Then when I am going to run the command create-react-app hello-world, it says create-react-app command not found. Then I searched for many solutions, I tried almost all of them, but nothing improved, showing the command not found again and again.
I had this same problem and this is how I solved it.
It will work on Ubuntu 16.04 as well as Ubuntu 18.04.
First, open up terminal and run this command:
sudo npm install -g -y create-react-app
After that, you will be able to use the create-react-app anywhere on your machine because it is saved globally.
Are u sure to run npm install with sudo? I had same problem and terminal couldn't write to folder with commands. Does your /usr/local/lib/node_modules/ folder contains create-react-app?
are you using create-react-app with sudo? because if you installed the package using sudo npm install create-react-app then it is installed for this user, try sudo create-react-app and if it works then you should change ownership to your user
I use to have the same problem in the terminal when i write npm install -g create-react-app and them create-react-app my-first-app.
So i went react doc and i find npx create-react-app my-first-app that worked for me.
Hope that will help.
If you read carefully then you will see after installing Yarn it tells you to add the following thing in your path.
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
~/.yarn/bin is for yarn binaries only.
Try it!
Source: https://github.com/yarnpkg/yarn/issues/5156

Command not found returned in terminal on almost every line

I'm trying to work with AngularJS but I can't even get pass installing it via Terminal.
I enter this onto the command line
npm install -g #angular/cli
I get this as a result
- bash: npm: command not found
I seem to be getting this same error log on almost every command, the rest return nothing
I'm stumped as to why it's not working.
For reference I'm using OS X 10.9.5
Make sure you got node installed which comes with npm
https://nodejs.org/en/
You error looks like you don't even have node installed on your computer, first of all, you need to install node js on you computer, once you’ve installed Node.js, you can make sure you’ve got the very most recent version of npm using npm itself: sudo npm install npm -g.
Then you can continue your installation with the step below:
To install #angular/cli locally run npm install #angular/cli --save, while to install it globally run npm install -g #angular/cli.
But if it requires a root access, then you have to include the sudo which will then be sudo npm install -g #angular/cli.
I figured it out. I needed to adjust the .bash_profile by entering this
echo "export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/b‌​in" >> ~/.bash_profile
Thanks to everyone who gave advice :)

npm install deployd –g issue

I need to setup the web server for Angular.js application using Nodejs. Accordingly I installed node.js version 6.11.0 in the path: C:\Program Files\nodejs
Next step is to install module of nodejs using the command:
npm install deployd -g
I am installing it in a path where my node_modules are installed.
When I run the command: npm install deployd –g I get one warning message (please see image for reference)
enter image description here
So I get to know that deployd is installed in the path C:\Program\node_modules\deployd.
Now if I run dpd –V command, it shows that dpd is not recognized as an internal or external command.
Can anybody please help me installing deployd?
I think this could help. It's worked for me.
npm install deployd-cli -g

Resources