ionic install fails on fsevents on Windows - ionic-framework

I have tried to install ionic on Windows but installation has failed. What should I do?
I have tried more than 20 times but still I got the same problem.
Here I have attached the screenshot for this
Entered commands:
npm install -g cordova
npm install -g ionic
Note: this one windows server machine

My guess is that the NPM global path has not been added to your windows path.
These are the steps to try:
First verify that the command just installed can run. The output contains the full path to the command installed, just copy and paste it to the command line. In your case it might be something like this %APPDATA%\Roaming\npm\iconic -v
Lets assume that works. That means that the command was successfully installed and will run, now we need to add it to your PATH so you can run it from the command line.
Next, Press Windows key and type "path" and select "Edit environment variables for your account". From here. Add or append the path %APPDATA%\Roaming\npm to your PATH variable, and save the results.
Once it is on your PATH you can run it from any command shell window.
Next, start a new command shell (e.g., Windows+R, cmd, Enter) and then type the command iconic -v. Viola, it should work without requiring the full path to the script.
I'm doing most of this from memory so hopefully it's correct. But if it needs some tweeks, let me know and I'll update the answer.
For completness, this install didn't actually fail. The lines with fsevents are warnings. The fsevents package is only designed to work on Mac Unix so these warnings can be safely ignored.
As Suraj Rao mentioned, also see Nodejs cannot find installed module on Windows?.

Related

I'm trying to use "flutterfire configure" but I'm getting an error. Can somebody have an issue for me please? [duplicate]

I'm trying to install flutterfire_cli in my root project, so I typed this command:
FirebaseFirestore firestore = FirebaseFirestore.instance;
so after that, this is the output of my console:
PS C:\Users\PC\Desktop\eventually> dart pub global activate flutterfire_cli
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 `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.
Activated flutterfire_cli 0.1.1+2.
To fix the warning I added C:\Users\PC\AppData\Local\Pub\Cache\bin to my Path in system variables environnement. (but it does not work, I'm still getting the warning)
Next, I'm trying to generate the firebase_options.dart file as the documentation says using this command:
flutterfire configure
But I'm getting an error in the console:
PS C:\Users\PC\Desktop\eventually> flutterfire configure
flutterfire : The term 'flutterfire' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ flutterfire configure
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (flutterfire:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Could anyone tell me what I am missing, why I am getting this error even if the Firebase CLI already installed on my machine?
Go through this doc very carefully: https://firebase.flutter.dev/docs/cli/
Step 1: Install Firebase CLI
Step 2: Install FlutterFire CLI with this command dart pub global activate flutterfire_cli
While doing this you must notice the following warning
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.
This means you need to add C:\Users\*username*\AppData\Local\Pub\Cache\bin into your System's environment path.
Step 3: Now flutterfire configure should work.
If still not working play with Firebase commands
For Mac -> Execute this command:
export PATH="$PATH":"$HOME/.pub-cache/bin"
Three 3 steps for getting it work on Windows:
Run this command:
dart pub global activate flutterfire_cli
Type env into Windows search and open Edit the system environment variables --> Environment variables --> System variables( the one on the bottom of the window) --> Double click on Path --> New and enter this:
C:\Users\PutHereYourUsername\AppData\Local\Pub\Cache\bin
flutterfire configure command should work now - close and open again command prompt or other terminal. Sometimes there is a problem with other editors and terminals where flutterfire configure still does not work. In that case open Command Prompt and it works there for sure.
As for me, I have done everything correctly and the command works if I run in the Windows command prompt, but it fails to work if I type the command inside the VS code terminal.
So I just killed the terminal and opened it again, then it works.
Or, you can try restarting your machine.
Even after adding C:\Users\PC\AppData\Local\Pub\Cache\bin to the path for me flutterfire would not work from the command line, the reason being that it actually instally a flutterfire.bat file.
So I use flutterfire.bat in the command line as of now and that is working.
For Linux/Ubuntu run this command in the terminal,
export PATH="$PATH":"$HOME/.pub-cache/bin"
Which you will also notice in the terminal when you run the command ↓.
dart pub global activate flutterfire_cli
Make sure you are your project directory
run this export PATH="$PATH":"$HOME/.pub-cache/bin"
For Linux/Ubuntu you should do the following:
Open your .bashrc file using the command "sudo nano ~/.bashrc"
Add export PATH="$PATH":"$HOME/.pub-cache/bin" to the end of the file.
Final you can source the file using "source ~/.bashrc"
It should now be able to recognize the file.
for macOS Monterey edit ~/.zprofile instead .zshrc
This was the hack i used to solve mine. I copied and pasted the C:\Users\PC\AppData\Local\Pub\Cache\bin in my folder search bar to enter the folder, note I could not find any folder called AppData, but when I pasted it on the folder search it did take me to the bin folder.
In the bin folder, you will find a file called flutterfire.bat. Copy and paste the flutterfire.bat file in the root of your project and then run the .\flutterfire configure command. Please do note the dot (.) and forward-slash (\). You need to add it to work.
for mac m1 , add
export PATH="$PATH":"$HOME/.pub-cache/bin" at the top of users/username/.profile , works on (monterey)
For me, even after I installed everything correctly, restarting my IDE(VSCode) did the trick.
Flutter command not found
Here is very easy instructions for adding something to your path on Mac, It solved my issues with Flutter and Flutterfire.
The export PATH="$PATH":"$HOME/.pub-cache/bin" did not work on my Debian machine!
I removed the first line #!/usr/bin/env sh from $HOME/.pub-cache/bin/flutterfire file and the flutterfire command worked properly.
Use command prompt.. not the vsc terminal
if you followed the right answer and still not working, you need to restart your computer

Windows neovim vim-plug error: `git` executable not found

I have already installed vimplug I can open the file but has no effect on Neovim 1
The error says that your plugin manager (vim-plug) isn't able to run the git executable. It needs to do this to fetch the plugins you're trying to load. So install git, make sure you can run it from your PowerShell command line, and you should be set.

nvm, node etc. paths missing from integrated terminal

I am using the insiders edition and zsh with ohmyzsh inside iTerm2 on OSX High Sierra.
If I launch the integrated command line in VSCode echo $path returns:
/Users/username/.yarn/bin:/Users/username/.cargo/bin:/usr/bin:/usr/bin/lldb:
/Users/username/bin:/usr/local/bin:/Users/username/.scripts:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
Obviously, the node path, nvm path etc. are missing so the terminal is not much use to me.
But typing echo $path in my terminal outside of VSCode returns:
/Users/username/.nvm/versions/node/v9.0.0/bin /Users/username/.yarn/bin
/Users/username/.cargo/bin /usr/bin /usr/bin/lldb /Users/username/bin
/usr/local/bin /Users/username/.scripts /usr/local/bin /usr/bin /bin /usr/sbin
/sbin /opt/X11/bin
Which has all the paths I need for my development activities.
I have this alias in my ~/.zshrc:
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCodeInsiders" --args $* ;}
If I launch code using the alias from an external terminal the node paths are correct.
As far as I can see this is because loading code from the Dock shortcut doesn't load the terminal using my user profile so it loads the profile from /etc/zprofile instead, which sets the path using /usr/libexec/path_helper so it misses all of my important paths that I need for development.
I suspect that most people would prefer the settings from their user profiles to be used. This would mean all of our dev apps would work from the integrated terminal and also the end of the infamous nvm is not compatible with the npm config "prefix" option error caused by the improper setting of paths.
How can I get VSCode to use the environment of the terminal in my user profile when launched from the Dock?
Go to settings and edit integrated terminal
// Object with environment variables that will be added to the VS Code process to be used by the terminal on OS X
"terminal.integrated.env.osx": {},
there you can pass in your variables
The vscode docs also offer a solution for the warning nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local":
https://github.com/Microsoft/vscode-docs/blob/master/docs/editor/integrated-terminal.md#why-is-nvm-complaining-about-a-prefix-option-when-the-integrated-terminal-is-launched
From the docs:
This is mostly a macOS problem and does not happen in external
terminals. The typical reasons for this are the following:
npm was globally installed using another instance of node which is
somewhere in your path (such as /usr/local/bin/npm). In order to get
the development tools on the $PATH, VS Code will launch a bash login
shell on start up. This means that your ~/.bash_profile has already
run and when an Integrated Terminal launches, it will run another
login shell, reordering the $PATH potentially in unexpected ways. To
resolve this issue, you need to track down where the old npm is
installed and remove both it and its out of date node_modules. You can
do this by finding the nvm initialization script and running which npm
before it runs, which should print the path when you launch a new
terminal.
Once you have the path to npm, you can find the old node_modules by
resolving the symlink by running a command something like this:
ls -la /usr/local/bin | grep npm
This will give you the resolved path at the end:
... npm -> ../lib/node_modules/npm/bin/npm-cli.js
From there, removing the files and relaunching VS Code should fix the issue:
rm -R /usr/local/bin/npm /usr/local/lib/node_modules/npm/bin/npm-cli.js

npm install -g generates the wrong script

This is a follow up this previous question related to how to install and run a javascript node.js command line tool.
According to this enter link description here you must execute npm install -g from within the folder of your project in order to be installed as a global command line tool executable from prompt.
When I run this instruction a .cmd file is created inside de global npm folder. But its content is wrong:
#"%~dp0\node_modules\lb-model-discovery\index.js" %*
I must manually change this content for it to be executed (otherwise I just get notepad being opened...) My question why npm install -g does not produced the right script in my system?
The solution is found in this github issue.
Basically the entry script (index.js) must contain this line at the top:
#!/usr/bin/env node

Chmod u+x windows cmd

I'm trying to install Scalatra on windows seven and need to change a file to executable...the Scalatra documentation says to do this, which is unix. What is the windows equivalant?
chmod u+x srt
You can simply open the relevant folder with a unix command prompt (I use git bash) and execute the unix commands from there
To get scalatra-sbt going on Windows, either port you own sbt.bat from scalatra-sbt, or install chmod via cygwin.
Assuming you've successfully installed the rest of Conscript and giter8, you can start a project that downloads scalatra-sbt. From there, one can look through the ./sbt source, and port the bash script functionality to your own windows specific script, or install a unix compatibility layer into Windows. If you go down the "windows specific script" route, perhaps the scalatra-sbt would appreciate the project contribution.
The "unix compatibility layer" route will eventually allow you to run ./sbt. chmod is a unix command line function, and is provided in a default package of the tool set cygwin, which provides a complete lunix-like environment. Once inside a cygwin terminal, you can chmod your file, as mentioned in the scalatra-sbt first project.
Diving into the contents of ./sbt from scalatra-sbt, this is actually unix script wrapper around the scala build tool (also referred to, confusingly, as sbt). If while trying to run ./sbt you get strange '\r' errors, install the cygwin package dos2unix, and then run it on the sbt file. If you run into any "which: no curl in..." or "which: no wget in..." errors, go back to the cygwin installer, find those packages such as wget, and then install those programs.
By the way, the last thing the scalatra-sbt script runs is the Scala build tool. The Scala build tool sbt itself has many reported issues with cygwin's default configuration, so you will likely need to do more research. Depending on what issues you're running into on your specific setup, you may need to make changes to the end of the ./sbt script to adjust the parameters used to launch the Scala build tool.