JPM not recognized as a command - firefox

I'm trying to write my fist firefox addon, but I can't seem to get jpm working. My OS is Windows 7. I have node js installed and I'm trying to follow the instructions here to install the add-on sdk. However, after I install jpm and I try running the command, I get the error jpm is not recognized as an internal or external command, operable program, or batch file." below is a screenshot of the command prompt window.

Let's say nodejs folder's path is C:/nodejs/
You can run jpm from the command line, but you must do it from nodejs installation directory.
If you wish to run it from any directory, what you need to do is edit a System Variable called Path, by appending to it the path to your nodejs installation, like this: ;C:\nodejs\. Afterwards open a new terminal (command prompt) session.
So for example: go to Control Panel -> search for "system variable" -> edit system variables -> find "Path" system (not user) variable on the list -> edit it -> append ;C:\nodejs\ to the end of its text -> open new command prompt.
I'm running a Polish version of Windows at the moment, so the guide isn't exact. I'll update it later. By system variable I mean global system environment variable as opposed to user environment variable.

I had the same problem...
when you install jpm using the npm --global option, the package is installed in c:\users\<your-user-name>\AppData\Roaming\npm\
In your example, you can either call jpm by specifying the complete path.
C:\users\B^3\AppData\Roaming\npm\jpm
Or add the C:\users\B^3\AppData\Roaming\npm to the environment variable PATH as suggested by #Sagi

Related

"code ." command is not working

I get this error:
code . is not recognised as an external or internal command, operable program or batch file
moreover shell commands are not coming in my compiler VS code neither do setx path "%path%;C:\Program Files\Microsoft VS Code" is working in command prompt .
It looks as if you do not have the code program installed. You can open the Command Palette,
Mac: ShiftCmdP
Windows/Linux: ShiftCtrlP
And search "install command", which should return this as one of the options:
Shell Command: Install 'code' command in PATH
Run that, and it should install the code command, after which you should be able to use it.
For Mac OS,
You can paste this into your terminal, or in your .bashrc file (or whatever shell config file you are using) :
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
I found it. In the "search" type environment variables then click on the "edit system environment variables".
Inside Environment variables->Path put C:\Users\{your_username}\AppData\Local\Programs\Microsoft VS Code\bin.
Go to the project folder and open the cmd with it typing in the location bar and then type code .
That will do.
in windows problem is with insiders version of VSC.
You can use 'code-insiders .' command or make a copy of 'code-insiders.cmd' file as 'code.cmd' inside folder with code-insider (use 'path' command to see where your VSC is installed)
make sure you run the command in C folder
Then click window key + R and type rundll32.exe sysdm.cpl,EditEnvironmentVariables
then enter .
It will open Environment Variables edit Path variable .
Check whether you have C:\Users\{pc name}\AppData\Local\Programs\Microsoft VS Code\bin if not add it and run code -v in C folder cmd
This worked for me !
For Windows OS
For Windows, you'll need to re-install code. You can download the latest version and just install it overtop of your existing install.
During setup, make sure to check the box to Add to PATH
See Also: The VSCode docs on installing the CLI
After installation, you need to restart your computer to make the PATH changes effective. Post restart, the command worked for me.
about linux, if u can't see the >shell option with ctrl+shif+p, You could install via
sudo snap install --classic code
and try again
code .

Cannot access RIDE robot framework from other users in same machine

I installed Robotframework RIDE with my user credentials and trying to access that by logging in with the another user in the same machine. when i copy paste the ride.py(available in C:/Python27/Scripts) file from my user to another user i can access RIDE by double clicking the ride.py file, but when i try to access using ride.py through command line i am not able access RIDE showing a error msg as "ride.py is not recognised as an internal or external command, operable program or batch file ". Installed python for all users and again re installed everything through pip in C:/Users, previously installed in C:/Users/MyUser. While i am trying to re install everything using pip in C:\Users it is showing as "Requirement already satisfied"
This error indicates that ride.py is not in the %PATH% sys variable:
"ride.py is not recognised as an internal or external command, operable program or batch file ".
Usually RIDE lives at C:\Python27\Lib\site-packages\robotide
You may try to run it with the full path in the command:
pythonw C:\Python27\Lib\site-packages\robotide\__init__.py
You may check if there is C:\Python27\Scripts\ride.py and the %PATH% variable for the other users (better to change it a System level).
About the error "Requirement already satisfied" from pip, that may be because:
1. RIDE is correctly installed (but you missed to run it in the first error)
2. You were calling a different pip install
finally got the solution, problem is not with the other users or installation, it is ride.py file which is missing in 'C:\Python27\Scripts' folder i replaced that file and now i am able to access ride.py from command prompt for all users in the machine.
Check the directory where you have the ride(Python file).
Upon opening the command prompt , for me the default path is C:\Users\etwxxbe.
Copy paste the ride(Python file) in the default path ,here the directory is etwxxbe.
Then use the command C:\Users\etwxxbe>ride.py to open ride.

Installing Heroku Toolbelt on Windows 10

I've been having some issues installing the Heroku toolbelt on Windows 10, 64-bit.
It's the first time I install Heroku. I downloaded it from https://toolbelt.heroku.com/windows.
After installing, I tried launching a new Git Bash and typing heroku login but what I got back was bash: heroku: command not found
Running the same command on Windows Powershell, what I got back was
'MYSQL' is not recognized as an internal or external command,
operable program or batch file.
'MYSQL' is not recognized as an internal or external command,
operable program or batch file.
Any suggestions? I thought that googling those lines would help, but I haven't found much.
I followed the recommendation from here, but now when typing heroku login on the Powershell, nothing happens. Nothing changes on the Git Bash.
I checked, and the Heroku folder was added to the PATH.
I thought I'd ask for some help before installing anything else.
Thank you!
bash: heroku: command not found
The error message is clear: Bash cannot find the heroku command, it's not on your PATH.
I checked, and the Heroku folder was added to the PATH.
It seems you didn't check it correctly.
Note that even if it looks correct in the PATH settings window,
Git Bash might have a different PATH configured.
To see the PATH in Git Bash, run:
echo $PATH
When debugging path issues,
it's best to first run heroku with the absolute path. For example if it's in C:\Program Files\Heroku\bin\heroku then you can run in Git Bash with:
/c/Program\ Files/Heroku/bin/heroku login
If this works (and it should),
then you can add it to PATH like this:
PATH="$PATH:/c/Program\ Files/Heroku/bin"
Note that Heroku will likely need other programs too on the PATH,
such as MySQL and Ruby.
Find their absolute paths,
and add there directories to PATH the same way as heroku itself in the above example.
If instead of Git Bash,
you want to work in CMD,
the procedure is the same,
but the syntax to print and set PATH is different:
echo %PATH%
set PATH="C:\Program Files\Heroku\bin;%PATH%"
In windows bash instead of this
PATH="$PATH:/c/Program\ Files/Heroku/bin"
use this
PATH="$PATH:/c/Program Files/Heroku/bin"
My working solution (for git-bash especially) is:
alias heroku='winpty `where heroku.cmd`'
stored in .bashrc in home user dir
and them
heroku
works as expected
If using bash from VSCode, I had to restart VSCode, after installing heroku. If not using VSCode, you probably need to restart your bash terminal, after installing heroku.
In Control Panel\All Control Panel Items\System (if you are using Windows), go to Advanced system settings, and there in Environment Variables, you'll find two lists, on the same window, viz. System variables, and User variables for your system. Make sure you add your path, viz. C:/Program Files/Heroku/bin, in both of these lists.
I know this is an old thread and just want to share my solution.
Edit .bashrc for git-bash
alias heroku='"C:\Program Files\Heroku\bin\heroku.cmd" $#'

Issues installing PhantomJS for windows: command not recognized

following the docs here: http://attester.ariatemplates.com/usage/phantom.html, I am trying to install phantomjs on my windows machine.
I tried adding multiple lines to my Path system variable, and yet, I get the same error in the command prompt when I type in phantomjs --version.
" 'phantomjs' is not recognized as an internal or external command, operable program or batch file."
I added the phantomjs.exe to C:\phantomjs\bin\, and added C:\phantomjs\bin\phantomjs to the path, and any variation that I could think of, such as:
C:\phantomjs\bin\phantomjs.exe\; C:\phantomjs\bin; C:\phantomjs\bin\phantomjs\;
How am I not installing this right?
You don't need to put all the directories to the environment PATH variable.
Add only following to your path and restart your command prompt.
C:\phantomjs\bin\
Add phantomjs.exe to C:\Windows\System32 folder.

'npm' is not recognized as internal or external command, operable program or batch file

I am completely new to nodejs. I am trying to get nodejs to work on my Windows 2008 box in order to install Karma which I would use for TDDing my AngularJs code. I have done the following steps so far
Install using Chocolatey ==> npm is not recognised
Install using 64-bit nodejs installer from nodejs.org ==> npm is not recognised
At this stage, running where npm gives me c:\User\<Username>\AppData\Roaming\npm which has nothing in it
I figure out that nodejs is installed in C:\Program Files\nodejs. Opening a command prompt in this directory makes npm work fine.
So I added C:\Program Files\nodejs to PATH only to get the same error again that npm is not recognized
One of the github issues on nodejs repository says that I need to restart the machine and it would fix. But that has not helped so far
I do see a Node.js icon in my Start -> Programms mennu which takes me to nodejs console but not sure what to do with that.
Have I missed any important step in the process?
Edit
I figured out that if I open "Nodejs command prompt" from program files, then npm is recognized. How do I make it work on a normal command prompt?
Edit
After node I started facing a similar problem with another application. I posted this question on superuser and as rightly pointed out by the accepted answer, I had an additional quote in my PATH which was causing issues with all the paths added after the quote. I have a feeling that some Chocolatey install adds this troubling quote but I am just not sure which one.
Just add:
;C:\Program Files\nodejs\
To the end of your Path variable on the "User variable" section of the Environment Variables on the System Properties.
After that, reopen your command prompt and type
npm
This should work.
Don't forget to reboot your computer after installing node! That one got me.
If you are using VS Code, close VS code and open again.
I tried closing Terminal and then opening new Terminal but it didn't work.
Re-Starting VS Code works!
To elaborate on Breno's answer... For Windows 7 these steps worked for me:
Open the Control Panel (Click the Start button, then click Control Panel)
Click User Accounts
Click Change my environment variables
Select PATH and click the Edit... button
At the end of the Variable value, add ;C:\Program Files\nodejs
Click Ok on the "Edit User Variable" window, then click Ok on the "Environment Variables" window
Start a command prompt window (Start button, then type cmd into the search and hit enter)
At the prompt (C:\>) type npm and hit enter; you should now see some help text (Usage: npm <command> etc.) rather than "npm is not recognized..."
Now you can start using npm!
For Windows users: A picture tells a thousand words
Reference: npm not recognized as internal or external command (Note: this is my own blog)
Just Download and Install Node.js from here https://nodejs.org/en/
If you run the downloaded file and install it, they will automatically configure for your system
You don't need any other configurations anymore, now you can use the npm command anywhere
If the Nodejs is successfully installed and still displays the message like this:
'npm' is not recognized as an internal or external command, operable program or batch file.
Follow the steps below for Windows users:
Go to My Computer Properties
Click Advanced System Setting from the Left bar of a window.
Now you have a System Properties window. Click Advanced
Then, Click Environment Variable button
Now you have Environment variable window: From System Variable, Select Path
Click Edit
At the end of the Variable value, add ;C:\Program Files\nodejs\
Note: If you have installed nodejs on other drives then please act accordingly.
Click Ok all the open dialogue box
Very important Note: "Close your Command Prompt And Restart Again"
(It's very important because if you didn't restart your command prompt then changes will not be reflected.)
Now you can use the npm command anywhere
Don't forget to run cmd as admin.
I understand this question is really old and we have many answers, unfortunately, my scenario was different, thus a different solution.
If you started using nvm to manage the node versions after you install the node in your machine, most likely you will be facing the same issue.
I installed a version 10.15.3 and then I had to use another version as there is some tight dependency with one of my projects. Then I decided to install the nvm, while installing it asked, whether I need nvm to manage the version already installed on my machine which is 10.15.3. And yeah, I said Yes hoping that it will take care of that, unfortunately, it didn't.
I was always getting this error no matter I tried many other things mentioned in the other answers here, including setting the path. In the end, to fix that, these are the things I tried.
Uninstall the node version installed, for example, nvm uninstall 10.15.3
Make sure no other node versions are there, nvm list
Then, install the version needed, for example, nvm install 10.15.3. This should give you an output as preceding.
Downloading node.js version 10.15.3 (64-bit)...
Complete
Creating C:\Users\SibeeshVenu\AppData\Roaming\nvm\temp
Downloading npm version 6.4.1... Complete
Installing npm v6.4.1...
Installation complete. If you want to use this version, type
nvm use 10.15.3
PS C:\Users\SibeeshVenu> nvm use 10.15.3
Now using node v10.15.3 (64-bit)
Please note that from the above command, the npm is also installed.
Now use the version you need, nvm use 10.15.3 and type npm
I had the same problem described by Ashu, but in addition to that, the PATH entry for nodejs was terminated by a backslash:
C:\Program Files\nodejs\
I also had to remove that final backslash in order to have it work.
I faced the exact same issue and notice that after installing node.js there was a new path entry in the user variable section for PATH with value --> c:\User\\AppData\Roaming\npm. Also the Path entry in the system variable is appended with --> C:\Program Files\nodejs. Now since user variable has preference over system you have two options to fix this. Either delete the path from user variable or correct the right path (C:\Program Files\nodejs). Restart CMD and it should work.
Set aside all the tips, just run the following line in cmd
> SET PATH=C:\Program Files\Nodejs;%PATH%
If you're getting this error through a service account like Visual Studio TFS Build controller service or any other background service, make sure you restart the service after installing npm as the new PATH environment settings will not be picked up by those already running processes. I was getting same error through my build service but I had npm installed and running in the console.
You might have already received a response but this might help others since I experienced the same issue recently and this is what I did:
Added a path for Powershell. For me, the path was C:\Windows\System32\WindowsPowerShell\v1.0
Then, I opened the command prompt with administrative privileges and ran
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
Next, choco install nodejs
Restart and everything worked fine. Try opening the command prompt without admin privileges and run npm -v
Cheers.
Had the same problem on Windows 8.1 64 bit.
Turns out i get that problem if I start cmd by typing it in the path bar at the top of a folder window or when i shift right click in a folder window and then open command prompt from the list.
When I run cmd using Run or Just from the cmd.exe executable it works.
I installed nodejs following this AngularJS tutorial. the npm command did work when I open a new cmd window but not in the current one.
So the fix was to close and open a new cmd window.
If the package is successfully installed and still shows the message "'npm' is not recognized as an internal or external command, operable program or batch file."
Click windows start button.
Look for "ALL APPS", you will see Node.js and Node.js Command prompt there.
You can run the Node.js Command prompt as administrator and soon as its run it will show the message "Your environment has been set up for using Node.js 6.3.0 (x64) and npm."
and then it works from there...
I ran into this issue as well. It turns out Windows doesn't enjoy single quotes on the command line. The culprit was one of my npm scripts. I changed the single quotes to escaped double quotes:
'npm -s run sass-build'
to
\"npm -s run sass-build\"
I'm updating this thread with a new answer because I've found the solution to my miserable situation after not less than a week ...
For those still experiencing the error even though they have their path value set properly, check your pathext variable to have the value (default value in windows 7 +) : .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
Mine was to set only to : .BAT and changing it solved the problem. I wonder why nobody brought this up ...
Hope this helps!
If everything looks fine. I would advice to check this for PATHEXT .CMD must be added.
I don't know why most of user suggesting ; / in the command.
I solved this by removing ; and /
Before
;C:\Program Files\nodejs\
After Solution
C:\Program Files\nodejs
You need to save them into system PATH variables
I ran into this problem the other day on my Windows 7 machine. Problem wasn't my path, but I had to use escaped forward slashes instead of backslashes like this:
"scripts": {
"script": ".\\bin\\script.sh"
}
Step 1: install NodeJs
step 2: Set environment path
Step 3: Restart PC once
I installed Node.js and while trying to install Ionic and cordova using this piece of code:
npm install -g cordova ionic
I faced the above error. I added 'C:\Program Files\nodejs' to my Environment Variable 'PATH'. But still was unable to get over this issue. Turned out that my PATH variable was longer than 2048 characters and so I was unable to add the Nodejs path to it. I had to remove the path of another program and add the Nodejs path.
Close and reopen the cmd prompt and try to install Ionic again.
This worked for me.
for me adding path to PATH didn't do the trick.
Run c:\Program Files\nodejs\nodevars.bat instead, it will do the job for you
Well in my case doing testing via Mocha i tried everything just to realize i have to remove single quotes around my test case script tag inside package.json.
I am running mocha test case on all *.test.js files as can see below:
package.json
Before:
"scripts": {
"test": "mocha server/**/*.test.js",
"test-watch": "nodemon --exec 'npm run test'"
}
After(removing single quotes - npm run test):
"scripts": {
"test": "mocha server/**/*.test.js",
"test-watch": "nodemon --exec npm run test"
}
Worked for me, just in case someone else also gets stuck on this.
Check npm config by command:
npm config list
It needs properties: "prefix", global "prefix" and "node bin location".
; userconfig C:\Users\username\.npmrc
cache = "C:\\ProgramData\\npm-cache"
msvs_version = "2015"
prefix = "C:\\ProgramData\\npm"
python = "C:\\Python27\\"
registry = "http://registry.com/api/npm/npm-packages/"
; globalconfig C:\ProgramData\npm\etc\npmrc
cache = "C:\\ProgramData\\npm-cache"
prefix = "C:\\ProgramData\\npm"
; node bin location = C:\Program Files\nodejs\node.exe
; cwd = C:\WINDOWS\system32
In this case it needs to add these paths to the end of environment variable PATH:
;C:\Program Files\nodejs;C:\ProgramData\npm;
If you used ms build tools to install node the path is here:
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VisualStudio\NodeJs
You don't need to "install" Node.js. Just download the package from https://nodejs.org/en/download/releases/ and extract the contents somewhere. Then, in a command prompt, you can navigate there using cd. Then you can run npm from that location. While you will have to do the cd C:\Users\YourAcct\Documents\node-v16.13.0-win-x64 or similar command before you can run it, it's a way to get it onto your computer and run npm without having to be an admin or editing environmental variables.
The issue is with system policy. I have tried the following comments in powers heel then it is started working
$> Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
$> npm install -g npm-windows-upgrade
$> npm-windows-upgrade
I got this idea from the following link
After adding environment varible path restart your machine maybe this will work. it work for me. i was using vm.

Resources