I successfully ran npm i -g netlify-cli on Git Bash (I’m running on Windows 10), but when I run netlify or any netlify commands, I get bash: netlify: command not found.
I opened a new terminal window, and even restarted my laptop, both to no avail.
I then tried searching this forum as well as Google, but (to my surprise) didn’t seem to find anyone experiencing this issue.
Hi, @msandula. Would you run the install command again? When it runs look for output similar to this (which will obviously differ on Windows):
/home/user/.nvm/versions/node/v11.8.0/bin/ntl -> /home/user/.nvm/versions/node/v11.8.0/lib/node_modules/netlify-cli/bin/run
/home/user/.nvm/versions/node/v11.8.0/bin/netlify -> /home/user/.nvm/versions/node/v11.8.0/lib/node_modules/netlify-cli/bin/run
> netlify-cli@2.32.0 postinstall /home/user/.nvm/versions/node/v11.8.0/lib/node_modules/netlify-cli
> node ./scripts/postinstall.js
Success! Netlify CLI has been installed!
Next test using the full path to the CLI tool. This might look similar to this:
$ /home/user/.nvm/versions/node/v11.8.0/bin/netlify version
netlify-cli/2.32.0 linux-x64 node-v11.8.0
This will confirm that the Netlify CLI tool is installed and working. If that works, the final step to resolve the issue will be to add the directory which contains this link to your bash environment variable PATH.
Here is the PATH environment variable for the system used in the examples above:
This is what I get after Step 1. Step 2 gives me the same ol’ command not found.
$ npm i netlify-cli -g
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not r ecommended for usage due to the number of issues. Please, upgrade your dependenc ies to the actual version of core-js@3.
C:\Users\msand\AppData\Roaming\npm\netlify -> C:\Users\msand\AppData\Roaming\npm \node_modules\netlify-cli\bin\run
C:\Users\msand\AppData\Roaming\npm\ntl -> C:\Users\msand\AppData\Roaming\npm\nod e_modules\netlify-cli\bin\run
> core-js@2.6.11 postinstall C:\Users\msand\AppData\Roaming\npm\node_modules\net lify-cli\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfill ing JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Colle ctive or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a goo d job -)
> core-js@3.6.4 postinstall C:\Users\msand\AppData\Roaming\npm\node_modules\netl ify-cli\node_modules\log-process-errors\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> netlify-cli@2.32.0 postinstall C:\Users\msand\AppData\Roaming\npm\node_modules \netlify-cli
> node ./scripts/postinstall.js
Success! Netlify CLI has been installed!
Your device is now configured to use Netlify CLI to deploy and manage your Netli fy sites.
Next steps:
netlify init Connect or create a Netlify site from current directory
netlify deploy Deploy the latest changes to your Netlify site
For more information on the CLI run netlify help
Or visit the docs at https://cli.netlify.com
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\net lify-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} )
+ netlify-cli@2.32.0
added 1029 packages from 482 contributors in 62.454s