Error: Command failed: C:\Windows\system32\cmd.exe /s /c “rm ./mean/package.json” - meanjs

How to fix this error. When i use command “yo meanjs”, but not show as in video. It’s:
undefined
You’re using the official MEAN.JS generator.
What mean,js version would you like to generate? i choose 0.4.0
In which filder would you like the project to be generated? mean
Cloning the MEAN repo…
Then it appear error:
Command failed: C:\Windows\system32\cmd.exe /s /c “rm ./mean/package.json”
‘rm’ is not recognized as an internal and external command, operable program or batch file.

you should install git on windown 7 and select folder you want . click -> right mouse -> Git Bash
After type command : "yo meanjs" and everything will good

The tpt2213's answer works, but it can't select menu items of "yo meanjs" with arrow keys.
You need to have cmd.exe with PATH setting, which includes the git command and Unix commands like the rm.
If you install git on window 7 in the folder, "C:\Program Files\Git", set PATH before you run "yo meanjs".
set PATH=C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;%PATH%
yo meanjs

Related

How to run html file on port 8080 through vs code

I am trying to run my html file on port 8080 through command 'http-server' but the terminal keeps saying 'command not found'.
I have tried solving this through 'npx http-server' and 'npm install -g http-server' but then I'm told that the 'npx' and 'npm' commands cannot be found as well.
hello friends please make sure you install node js correctly and maybe this article could help
try node -v for check node is install or not
try npm -v for check npm is install or not
NOTE if you are using windows please make sure to add PATH
how to add PATH in windows
search 'Environment Variables' on global search
Choose “Edit system environment variables”.
Click “Environment Variables” in the “Advanced” tab.
In the “System Variables” box, search for Path and edit it to include the path C:\Program Files\nodejs. If you don’t see it there click “New” then add this path. (Note: Depending on your version you may just need to edit and append this path to what’s there by prefixing it with a semicolon. You’ll see the other paths there are also separated by semicolons).
If you are using linux it could be the permission issues
sudo chown -R $(whoami):admin /usr/local/lib/node_modules/
https://linuxhint.com/npm-command-not-found/

Problem with the command-line JSON processor JQ in Windows 10, 64 bit

I have downloaded the program jq-win64.exe from 'https://stedolan.github.io/jq/' and installed the program in a folder C:\Program Files\jq\ on my computer.
I have also added the PATH to the program to the end of the systemvariable string in Windows 10 : . . . ;C:\Program Files\curl\;C:\Program Files\jq\
In one terminal window in Visual Studio Code I am running a server.
In another terminal window I am trying to execute the command curl -s localhost:3000 | jq
Terminal window 1:
C:\Users\SteinarV\PROFF_JAVASCRIPT\PROJECT\smartHouse
node server.js
API running on port 3000
Terminal window 2:
C:\Users\SteinarV\PROFF_JAVASCRIPT\PROJECT\smartHouse>curl -s localhost:3000 | jq
'jq' is not recognized as an internal or external command,
operable program or batch file
... and do not understand why jq is not recognized.
Can someone help ?
I have downloaded the program jq-win64.exe from 'https://stedolan.github.io/jq/' and installed the program in a folder C:\Program Files\jq\ on my computer.
As you have indicated, you have a file called jq-win64.exe but you are trying to execute the command jq. You either need to rename the file to jq.exe or you need to use the command jq-win64.
For a detailed explanation of how Windows finds and executes a program in your path when you enter a command, see The Windows NT Command Shell: Command Search Sequence. Specifically:
...The shell now searches each directory specified by the PATH environment variable, in the order listed, for an executable file matching the command name. If a match is found, the external command (the executable file) executes...
...If the command name does not include a file extension, the shell adds the extensions listed in the PATHEXT environment variable, one by one, and searches the directory for that file name. Note that the shell tries all possible file extensions in a specific directory before moving on to search the next directory (if there is one)...
You indicate in the comments the same error persists even when the filenames match. Note that each running program has its own set of environment variables, and these aren't updated by global changes. You need to close and reopen cmd.exe windows after making a global change. See also Adding directory to path environment variable in windows. You can use the path command to verify whether a particular terminal session has inherited the PATH variable you defined, thus narrowing your problem.
You indicate that the problem still persists. You need to use the tools available to you to narrow it down further:
Try running the program with its full path:
"C:\Program Files\jq\jq-win64.exe" --help
This will confirm that the program is present where you think it is and can be run from the terminal.
Try running the program with no path and its extension:
jq-win64.exe --help
If this works but running the program without an extension doesn't, you might have set PATHEXT to something that doesn't include ".EXE".
Try setting the path explicitly in the terminal to contain only the program directory and nothing else, then run it with its full extension:
set PATH=C:\Program Files\jq
jq-win64.exe --help
(Note that after this test you'll need to close the terminal window and start a new one to reset the path.)
If this works, perhaps you have a mismatch in your path.

How to open a project in PhpStorm from command line on Windows

How to open a project in PhpStorm from command line on Windows?
I tired this:
How to open a directory in PHPStorm or IntelliJ (or any JetBrains IDE) from the command line? but can't find Tools -> Create command line launcher on Windows.
I am using latest PhpStorm.
To open the current directory just run:
phpstorm64 .
If you are using git bash on Windows run:
cmd "/C phpstorm64 ."
Make sure that C:\Program Files\JetBrains\PhpStorm 2018.3.3\bin is in your environment variable PATH (it is by default after the installation)
Edit 2021:
Install Jetbrains Toolbox
Go to settings
Enable "Shell Scripts" and follow the instructions
Now you can use "phpstorm ." to open the current directory.
On macOS ( I assume on windows too) there is option to "Create Command-line Launcher". Just click that and you are good to go next time you open a terminal.
You can even specify how you would like to start "pstorm" / "phpstorm" / "ps" etc.. up to you.
Command-line launcher is currently only available fo UNIX; there is a feature request for providing it on Windows, IDEA-114307, please feel free to vote for it.
If you like to start PhpStorm from command prompt, open cmd console, cd to %PS_install_dir%/bin and run either phpstorm64.exe or phpstorm.bat, passing a path to project folder to it, like it's described in https://www.jetbrains.com/help/phpstorm/opening-files-from-command-line.html. If you like to start it from any directory, add %PS_install_dir%/bin to your system %PATH%
I know this is too late, but it will help others if they need it:
if you want to open phpStorm in the current directory via cmd/Powershell, just use this command:
phpstorm64.exe .
Or if you want to open it in another directory, just use:
phpstorm64.exe YOUR_DIRECTORY_PATH
as simple as that!
go to your project using terminal
Cd myproject
and write
phpstorm64.exe
then hit enter
I see this is a little old but I wanted to supply my answer as I was grappling with this yesterday. My solution was to use cygwin.
Track down the phpstorm bin folder called something like C:\Users\UserName\AppData\Local\JetBrains\Toolbox\apps\PhpStorm\ch-0\201.7223.96\bin and add it to your windows system Path environment variable.
Next fire up a cygwin terminal and navigate into your project directory. I'm not a bash expert so I struggled to sort out the code as an alias but if you run:
crntproj=$(cygpath -w $PWD)
phpstorm.bat $crntproj
You need cygpath because simply running phpstorm.bat $PWD doesn't work as PHPStorm tries to open a folder called $PWD. I tried a bunch of variations trying to get it to open and none seemed to work.
It will fire up phpstorm with the current folder as the project path. And you now have a terminal feed from your project too.

PHP Mysql laravel 5.4 terminal issue

i am new to laravel i just figured out how to install composer laravel etc etc on my local machine MAMP on windows , Now i am confuse with the command on terminal which is
C:\project>mysql -uroot -proot
'mysql' is not recognized as an internal or external command,
operable program or batch file.
How can i fix this ?
setting Environment will solve the issue
Go to Control Panel -> System -> Advanced
Click - Environment Variables
Go to- System Variables find PATH and click on it.
add the path to your mysql\bin folder to the end paths. (ex: E:\xampp\mysql\bin) and add ; end of the line
Close all the command prompts you opens.
Re open and try it.
Setting the PATH to point to the MYSQL bin folder is normally the first thought, but I find that dangerous as things get left lying around when you change software.
I normally create a little batch file in the projects folder or in a folder that it already on your PATH, like this
mysqlpath.cmd
echo off
PATH=C:\mamp\path\to\the\mysql\bin;%PATH%
mysql -v
The mysql -v will output the mysql version number but it is a handy way of knowing that the correct folder has been added to the PATH. This adds the folder to the PATH but only for the life of the command window.
Then just run this from any command window when you want to use MYSQL from the command line
> phppath
You may also like to create one for PHP as well
phppath.cmd
echo off
PATH=C:\mamp\path\to\the\php\;%PATH%
php -v

Windows: How to open a .exe in a shell window that won't close?

I've had this problem for ages, and it's SO ANNOYING.
Suppose I want to run mysqldump.exe... here's my process: Start->run, type "cmd" ... dir into directory after directory until I finally get to c:/program files/mysql/bin/then I can FINALLY call "mysqldump.exe"
I don't mind using Windows Explorer to get to c:/program files/mysql/bin, but then I can't freaking open up any of the .exe files in a shell, and I can't open up shell with the directory being that one.
How can I do this?
This is what I do for those type of commands:
Drag a copy of the "Command Prompt" shortcut onto your desktop.
Open the properties of the shortcut.
Change the Target: field to: %SystemRoot%\system32\cmd.exe /k mysqldump.exe
Change the Start in: field to: c:/program files/mysql/bin/
Hit Ok, then rename the short cut from "Command Prompt" to "Mysqldump".
Then just double click the icon whenever you need that command. The "/k" option for cmd.exe leaves the window open.
Microsoft released a powertoy for Windows XP called Open Command Prompt Here. If you're using Vista, all you need to do is hold shift and right-click.
here's my process: Start->run, type
"cmd" ... dir into directory after
directory until I finally get to
c:/program files/mysql/bin/ then I can
FINALLY call "mysqldump.exe"
Why not just the following?
c:
cd "c:/program files/mysql/bin"
mysqldump.exe
Better yet, put this in a batch file and execute it.
You can also create a shortcut for cmd.exe and set the "Start in" directory to "c:/program files/mysql/bin".
You can download an add-in so that you can right click on the folder and open a command prompt. Saves a lot of time and you say you dont mind navigating to the location.
http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe
A nice little trick is that the icon in the adress bar of explorer could be dragged to a command line window and it insert the full path at your current cursor position.
It doesn't work in vista but if you SHIFT-RightClick on a folder you have an "Open Command Windows Here" option that appears.
Under xp you could have it by saving this as a .reg and executing it :
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd]
#="Open Command Prompt Here"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\cmd\command]
#="cmd.exe /k pushd %L"
Just use the explorer to navigate to the bin or any directory. then enter cmd at the address bar und hit return. the command line with start at this location.
You can do it with python:
If you don't have activepython already, download from ActiveState's Website. Next, run PythonWin and create a new script. Write the following:
from subprocess import *
Call("c://program files//mysql//bin//mysqldump.exe")
Save the script somewhere. When you want to run it, just doubleclick. There are easier ways if you like writing batch files, but Python is more succinct than even windows for this case.
Just put c:/program files/mysql/bin/ into your path...
Then you can run mysqldump.exe directly without even opening a cmd prompt by typing it into " Start > Run "
I was using the MS PowerToy for a while but moved on to the open source Open Command Prompt Shell Extension because of the key feature:
(copied verbatim from the website)
The ability to open a command prompt in the directory that you are currently in by right-clicking on any empty screen space in the directory. This eliminates the need to navigate up a level in order to open a command prompt in the current directory.
Having to actually click on a folder to open the command prompt using the MS tool was a annoyance for me... especially since I always need to run command line tools on my current directory at the time.