"meteor" shortcut not working over SSH - meteor

I created an admin user ("win7desktop") on my iMac. As that user, I installed meteor.js and created a project ("coolApp").
Then I went to my Windows PC and (using PuTTY) logged into my iMac via SSH as user "win7desktop". I navigated to "coolApp" and tried entering "meteor", but that gives me "command not found". I can enter "/usr/local/bin/meteor", and that seems to work.
What did I do wrong? How do I make the "shortcut" work?

It seems like your path isn't being set up properly when you ssh over!
if running:
which meteor
returns nothing (or an error), then you can run
PATH=$PATH:/usr/bin/meteor
to temporarily add it to your path. If that works out, you may want to add that above line to your ~/.bashrc file, so its run whenever your shell starts.

Related

'flutterfire configure' command not working, I need to set firebase in my flutter project

I followed "https://firebase.flutter.dev/docs/overview" instruction to set firebase in my flutter project.
step i took:
"flutter pub add firebase_core" then dependencies were added, and generated_plugin_registrant.dart was created.
generated_plugin_registrant.dart file
2) "dart pub global activate flutterfire_cli" it showed an warnign message ie "Warning: Pub installs executables into C:\Users\Asus\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.
Activated flutterfire_cli 0.1.1+2."
then i added "C:\Users\Asus\AppData\Local\Pub\Cache\bin" in system; "path" environment variable.
"flutterfire configure" now it gives error "bash: flutterfire: command not found".
Step by step commands for getting flutterfire work in Mac:
dart pub global activate flutterfire_cli
export PATH="$PATH":"$HOME/.pub-cache/bin"
curl -sL https://firebase.tools | bash
firebase login
flutterfire configure
More details here
Windows Step-by-Step guide:
Open the Windows Search Bar, type in “env”, and choose “Edit the system environment variables”
Click the “Environment Variables…”
In System Variables box, search for "PATH" and double click on it
Click "New" and then paste the following line, replacing *USERNAME* with your Windows username
C:\Users\*USERNAME*\AppData\Local\Pub\Cache\bin
Click Ok and restart your IDE, then try flutterfire commands
I had the same problem. Following command worked for me (in Windows).
flutterfire.bat configure
I had same problem and I solved this by:
Added C:\Users\<username>\AppData\Local\Pub\Cache\bin to Environment Path.
Restarted IDE
Executed command: dart pub global activate flutterfire_cli
Here's a solution that worked for me:
From your terminal,open your bash profile in your home directory. Example home directory, Users/your-name/. I'm using macOS, so I typed typed the command sudo vim ~/.bash_profile from my home directory folder, followed by E to edit.
Scroll to the bottom of the file or below # Flutter ENV, on your keyboard, hit i to insert, then paste the following line, export PATH="$PATH":"$HOME/.pub-cache/bin". Press ESC, type ":wq!" then press Enter to save the changes and exit vim.
From the command line, reload your bash profile with source ~/.bash_profile. flutterfire configure should now work.
Hrishabh
This worked for me.
Close your IDE.
Restart IDE.
Re-run "flutter pub add firebase_core" in your terminal.
Finally run "dart pub global acttivate flutterfire_cli" in your terminal.
I had the same problem here is the way to solve it:
Warning: Pub installs executables into C:\Users\userName\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.
Go the Windows searchbar and write var
Select modify system environment
Click on environment variables
On system variables click on Path
Click on Edit
On the modify the environment variable windows click on New
Copy paste C:\Users\userName\AppData\Local\Pub\Cache\bin
Close all the windows clicking on Ok
Restart Android Studio
Inside Android Studio terminal write this to check if succeed
dart pub global activate flutterfire_cli
You should have the following message:
The package flutterfire_cli is already activated at newest available version.
On windows, from flutter root folder, running 'flutterfire configure' I got the same error message.
The 'problem' was resolved when I removed the following lines from pubspec.yaml.
plugin:
platforms:
ios:
pluginClass: AppDelegate
(I added those lines in an attempt to create a "podfile" that is required in order to create a binary ios file. )
For me it required a little bit more work but this is what worked for me, I'm using Windows:
As mentioned already before I ran these steps:
1). Search for "Edit System Environment Variables"
2). Click on Environment Variables
3). Under System Variables, double click on "path."
4). Click on "New" and add C:\Users\USERNAME\AppData\Local\Pub\Cache\bin
5). Click OK and restart IDE
After restarting IDE I ran the following commands in the terminal and this time it worked
1). Firstly, flutter upgrade firebase_core
2). Then, I ran dart pub global activate flutterfire_cli again and this time when I ran flutterfire commands it worked.
For me it wasn't working in bash. When i switched over to the standard windows comand prompt it worked.

Best way to add environment variables to MobaXterm

I'm just now setting up MobaXTerm on my local computer and I'm looking to see what is the best way to port over all my environment variables I have on my windows host over to MobaXTerm. The whole goal of this exercise is that I plan to not use command prompt/git bash but instead just use MobaXterm.
For example, if I go to my Command Prompt and type in 'python', I can type Python code in the command line. Now when I do this in MobaXTerm, it says that I don't have it installed. This extends to more applications so I would rather not try and manually install git,python, etc. in my MobaXTerm manually.
I've extracted a list of all environment variables on my Windows host by typing in 'set > paths.txt' in the command prompt, but I want my MobaXTerm command line to reference these when I am using the terminal there. What is the best way to do this? Is it setting it up in a .csrhc?
Edit: I tried changing the settings in MobaXterm to use the Windows PATH environment, and even when I restarted my computer I still haven't gotten it to work
In the "Terminal tab settings" section, so you will find this option in the "Terminal" tab.
Go to MobaXterm global settings window, then click on the "Terminal" tab and check the "Use Windows PATH environment". Note that if you are using a session, you will have to do the same in this session: edit your session, then go to the "Terminal settings" tab and check the "Use Windows PATH" option.
I had the same issues while trying to use git. It looks like MobaXterm keeps using his own executables located %USERPROFILE%\Documents\MobaXterm\slash\etc, and even recreates them when you delete them.
You can still force MobaXterm to use windows PATH configurated executables by launching cmd /c yourcommand, in my case cmd /c git push. It will run windows CMD command using your PATH environment variable.
You have to check "Use Windows PATH" on the "Terminal settings" of your MobaXterm session settings in order to works.

'wp' is not recognized, but wp-cli works fine on Windows 10

I've installed wp-cli and expect to have the 'wp' command working. I have done this installation process on a near-identical machine just fine. When I enter 'wp' into Command Prompt (Admin), I get 'wp' is not a recognized as an internal or external command. I have PATH variables set to c:\wp-cli and c:\xampp\php for Admin and the System Variables. I can't seem to run "npm run setup" until this happens, so I would appreciate any guidance. Thank you.
This is fixed. Make sure to name you wp-cli.bat file wp.bat instead. My other Windows machine was more discerning, apparently.

"Homestead Improved" Vagrant VM - Failed to restart php7.0-fpm.service: Unit php7.0-fpm.service not found

I'm trying to get a Homestead Improved Vagrant VM instance running on Windows.
See Homestead Improved on Github. I'm following this easy introduction:
https://www.sitepoint.com/quick-tip-get-homestead-vagrant-vm-running/
My steps are:
git clone https://github.com/swader/homestead_improved my_project
cd my_project
bin/folderfix.sh
vagrant up
Machine boots and is ready. Then provisioner is running. Then I get the follwoing error message:
==> default: Failed to restart php7.0-fpm.service: Unit php7.0-fpm.service not found.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
Any hints what to do?
This has been fixed on the repo-level, and should never happen again if you run git pull inside your homestead improved cloned folder (but outside of the VM, not SSH-ed into it). If your machine is already running, you might have to apply the steps below, too. But new machines (so new clones of Homestead Improved) will not have this happen any more). Explanation of what happened is here.
#daniel-sixl please try to re-download/re-clone and start from scratch, everything should be working just fine now.
Old solution:
Try to change php7.0-fpm to php7.1-fpm - the box was auto-updated to the new version.
You can do this by going into /etc/nginx/sites-available and changing the required file - its name will match the site you defined, as per that post you linked. So probably /etc/nginx/sites-available/homestead.app.
--
Edit: added more detailed instructions for people very new to it all.
Ok, so what you need to do is, once you're in the sites-available folder, edit the homestead.app file. Something like sudo vim homestead.app will do just fine, it'll open a basic text editor (that's quite nightmarish to use when you're new at it, so just be patient :) ) Sudo is important, because you are editing a file that only an admin has access to.
Once you're "in", do the following:
press / (this activates "search") and input php7.0-fpm. This should take you to the line which contains that phrase. If you press / again and press Enter, that works like "find next", so it'll go to the next line having the phrase, or restart from the top if no other lines contain it.
when your cursor is on the line with php7.0-fpm (you can move it around with arrows of course), press i. This activated "insert" mode. Now you can edit the file.
change the 7.0 to 7.1.
press ESC to exit edit mode, and go back into read-only mode.
repeat for each line with 7.0
once done, while in read-only mode (ESC to make sure), type :x. Yeah, like an emoticon with cross lips. Press Enter. That's short for "Save and Exit".
you will now be in the folder again, from where you should execute sudo service nginx restart.
The new configuration should now take effect, and everything should start working.

Ionic framework - command 'grunt serve' returns 'multiple addresses available' and freezes

Used Yeoman ionic-generator
https://github.com/diegonetto/generator-ionic
Where I ran it without sass, default plugin list and blank.
And when running grunt serve I get the following:
Multiple addresses available.
Please select which address to use by entering its number from the list below:
1) 192.168.1.69 (en0)
2) localhost
Address Selection:
When I type 2 in terminal and return it just hangs there without going further or launching a browser.
I have tried also typing localhost or 'localhost' and returning, still nothing it just hangs...
I am so confused to why?
Any help on the matter would be most appreciated, thank you.
This morning i ran in the same problem as you did. I look into the Ionic serve code (.\node_modules\ionic\lib\ionic\serve.js) and compared it with another file, i didnt found any difference.
So instead using the "grunt serve" command i tried the "ionic serve" command. This script the didn't hang in the commandline so i could select an address. (in my case i selected 2 (the localhost)).
From this point it remembers the option you selected. so you can run "grunt serve" command again.
If the command "ionic serve" isn't working try to install ionic: "npm install -g ionic"
Edit the file ionic.config in: (Mac) ~/.ionic or (Win) c:/users/username/.ionic
add: "ionicServeAddress": "localhost" to the config file
It will choose local host automatically and then "grunt serve" will not ask you for an address.
I found the solution here: https://stackoverflow.com/a/26330536/2925856
The reason here is that Grunt Watch is running, it will block the terminal from other works so we cannot do anything when Grunt Watch is running. Maybe you can disconnect internet from the wifi and disconnect all Lan cable connect to your computer to make sure you only have one local ip address and run grunt serve. After that you can connect all these things again. Another solution is that it might need to set time out in serve.js in ionic lib to auto assign the selection for us or event remove the step of choosing Multiple IP Selection by auto assign to localhost.

Resources