heroku cli reports The system cannot find the path specified on Win 10 - heroku-cli

I'm having a problem with the Heroku CLI.
I was following the Heroku tutorial for Node.js.
I installed the Heroku CLI and checked that node --version, npm --version and git --version were at the latest version available.
I then run the command "heroku login" from git bash, but after inserting the email it complained about permissions so I re run git bash in administrator mode and everything seemed fine, I got to the part where you do "heroku create" it started downloading something but then I had a warning about not using git bash for "create" but to opt for powershell or cmd.
So I switched to cmd.exe with admin privileges but now the "heroku" command does nothing:
"$ heroku
The system cannot find the path specified."
The error seems related to my os, I checked my Windows Environment Variables and the path to heroku's exe is correctly set up (in fact it worked a bit earlier) to "C:\Program Files\Heroku\bin".
So I don't know how to use heroku at this point or what can I do to fix this error.

Related

flutterfire : The term 'flutterfire' is not recognized as the name of a cmdlet, function, script file, or operable program

I am getting this error when I run "dart pub global activate flutterfire_cli" :
Activated flutterfire_cli 0.1.1+2. Package flutterfire_cli is
currently active at version 0.1.1+2. Resolving dependencies... The
package flutterfire_cli is already activated at newest available
version. To recompile executables, first-run dart pub global deactivate flutterfire_cli. Installed executable flutterfire.
Warning: Pub installs executables into
C:\Users\PC\AppData\Local\Pub\Cache\bin, which is not on your path.
You can fix that by adding that directory to your system's "Path"
environment variable. A web search for "configure windows path" will
show you how
I have added this to my user path but I am still getting this error.
I checked for solutionsto similar problems which suggested I restart the windows or vs code or terminal - I did all three but it is still not working .
I ran in cmd in that it did not give the warning but when I ran flutterfire configure . It gave this error:
"FirebaseCommandException: An error occured on the Firebase CLI when
attempting to run a command. COMMAND: firebase --version ERROR: The
FlutterFire CLI currently requires the official Firebase CLI to also
be installed, see
https://firebase.google.com/docs/cli#install_the_firebase_cli for how
to install it."
running firebase --version gave this error:
'firebase' is not recognized as an internal or external command,
operable program or batch file
This should not be happening as I did connect my app to firebase console.
What worked for me is instead of typing
flutterfire I use flutterfire.bat, e.g. flutterfire.bat configure, that way the command works in the git bash with windows.
You have to add Flutter SDK path to your system environment. The error is arising because your system is not able to find the folder where you have installed Flutter in your system.
You may refer to the Stackoverflow case for the steps on how to set path for the system environment.
Alternatively, you may also refer to the video link.
If you have windows 10. Do not use firebase-tools-instant-win.exe its a trap!
Add Paths to System Variables. Don't forget to change to your username in YOU-USER-NAME
C:\Users\YOU-USER-NAME\AppData\Local\Pub\Cache\bin
C:\Users\YOU-USER-NAME\AppData\Roaming\npm
Next you can execute anywhere (in cmd or firebase-tools-instant-win.exe)
firebase login
npm install -g firebase-tools
dart pub global activate flutterfire_cli
Next you open only cmd.exe command promt and go to the root of your project.
cd c:\PATH-TO-YOU-PROJECT
flutterfire configure

Firebase CLI commands do not work with VS Code Git Bash Terminal

I have npm installed and reinstalled firebase-tools (globally), but when working in VS Code terminal through GitBash I am getting this error on any firebase command:
C:\Users\{user}\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found
I do not get this error when using Command Line or PowerShell through VS Code or standalone, only with Git Bash. This error does not happen when I add .cmd to firebase.
firebase --version = error
firebase.cmd --version = 8.4.2
If anyone can shed some light as to why this is happening I'd appreciate it. I don't mind using PowerShell but I would like to know the "why" behind this error.
Versions:
VS Code 1.46.0
Firebase 8.4.2
npm 6.14.4
git 2.27.0
The operating system is Windows 10.
Try this
npm uninstall firebase-tools
npm cache clean --force
If that doesn't work then you should physically delete C:/Users/{username}/AppData/Roaming/npm and C:/Users/{username}/AppData/Roaming/npm-cache and reinstall global npm modules.
There is an open issue regarding this error, which is similar to your error.

How to use dotnet tool during Travis-CI build?

I'm trying to use dotnet-warp as a global tool in my .NET Core Travis-CI build, because I like the idea of a single executable so much better than a folder full of 75ish files.
I can successfully add the tool and verify there's a tools/dotnet folder in the $PATH...
But the log indicates that because .NET Core has been added recently, I'll need to restart or logout before I can actually use the tool.
Is anyone aware of a way to make this work in the Travis-CI environment?
Ran into the same issue, using the info from the Travis CI Installing Dependencies page and this comment on an issue about it, adding the following following to to my .travis.yml solved the problem:
before_script:
- export PATH=$PATH:/home/travis/.dotnet/tools
My build log:
$ export PATH=$PATH:/home/travis/.dotnet/tools
$ dotnet tool install -g dotnet-warp
You can invoke the tool using the following command: dotnet-warp
Tool 'dotnet-warp' (version '1.0.9') was successfully installed.
The command "dotnet tool install -g dotnet-warp" exited with 0.
$ cd ./src/[my project]/
The command "cd ./src/[my project]/" exited with 0.
$ dotnet-warp
Running Publish...
Running Pack...
Saved binary to "[my project]"
The command "dotnet-warp" exited with 0.

heroku cli commands not responding on windows 10

I installed heroku cli on windows 10 via exe installer.
When i try to run heroku --version command or heroku login
command, the command window does not respond. It does not give any error.
Then i uninstalled it and installed it using npm install -g heroku-cli
but getting same result.
Node version - 8.7.0
In Windows cmd prompt, do:
echo %USERPROFILE%
Go to your C:\Users\YOURNAME
Look for a file named:
_netrc
This file stores login credentials. Delete it.
Then check for an update:
heroku update
Then try to log in:
heroku login
I saw some people create an environment variable called HOME and add the path to YOURNAME so the environment knows to look for the _netrc file there.
Other trouble-shooting ideas if the above doesn't work for you can be found at Heroku CLI troubleshooting
In windows , run %LOCALAPPDATA%\heroku, completely delete this folder. and check again on cmd by typing heroku --version. Hope this helps.
I ended up uninstalling heroku from the Windows Installer and instead used the standalone tarball.
You can get the tarballs from here.
After you downloaded and extracted it, you can go to your terminal and cd into the directory where you extracted the file and do the following command:
./bin/heroku --version
Whenever you need the heroku CLI, you can cd into the directory where heroku is, then ./bin/heroku is the executable for heroku.

%1 is not a valid Win32 application.. Sqlite3 in Electron app

I’m trying to get sqlite3 to work in an electron app running on Windows7 and 10. Running the following command, I was able to create electron-v1.7-win32-x64\node_sqlite3.node
cd node_modules/sqlite3 && sudo npm install nan
&& sudo npm run prepublish && sudo node-gyp configure --module_name=node_sqlite3 --module_path=…/lib/binding/electron-v1.7-win32-x64
&& node-gyp rebuild --target=1.6.11 --arch=x64 --target_platform=win32 --dist-url=https://atom.io/download/atom-shell
--module_name=node_sqlite3 --module_path=…/lib/binding/electron-v1.7-win32-x64
However, I get Uncaught Error: %1 is not a valid Win32 application. \\?\c:\folder\ppt_win32-x64\resources\app\node_modules\sqlite3\lib\binding\electron-v1.7-win32-x64\node_sqlite3.node.
My node version is v7.4.0. Electron v1.6.11.
I was trying to compile for windows from mi Mac and I had that problem too, but after some readings I figured out how to proceed, and after all I can say that I got it. Yesterday I spent all day setting up a windows virtual machine in my (other) Linux laptop (I used my linux laptop just because my mac was exhausted in storage...). I was having too a problem with the preloadScript from electron main process in windows, Cant found the script, it was solved too.
Anyway, I think the library node printer from #tojocky is well maintained, in other hand in the electron-builder documentation they say that you should compile in native for natural reasons. Once you will have it, you'll see that it's a cleaner and pragmatic solution ...
This was my entire process, I hope it helps to someone having the same issue:
Get VirtualBox (or Parallels but is not free)
Get iso for W10
Create a VM with this W10 iso, and you should give to this VM some storage (because some dependency that you'll need to compile), I have assigned 60gb to this VM
Once I had that VM running, I just installed in that machine Visual Studio 2017 (with their build-tools included, it's necessary)
And then, I used CMD to make the rest
Install NodeJS (and NPM, but it comes with)
Install node-gyp globally
Install Python 2.7
Clone your project from git (in my case)
npm i (in your project), you should have as npm dependency in your package.json the module electron-builder of course. (here I had some troubles because when node-gyp tried to rebuild printer to generate the binary for windows it was failing, this was because it was imposible to find the python executable, so if you face this problem you should add it like:npm config set python "c:\Python27\python.exe" in my case )
Then try again npm i and Voila!
If you still having error you can rebuild the native dependency as well, run:
node-gyp rebuild --target=YOUR_ELECTRON_TARGET[eg: 1.8.4] --arch=YOUR_ARCH_TARGET[eg: x64 | ia32] --dist-url=https://atom.io/download/atom-shell
After all, you should make the build using electron-builder, in my case my npm script command was build --win --x64 but you can use the --ia32 flag as well for 32bits

Resources