gulp-shell 'karma is not recognized an an internal or external command...' - node.js

I'm using gulp to concat, minify, and then test all of my JS. I want to include karma in there as well, but I can't seem to get gulp-shell 'karma start karma.conf.js' to work properly. Karma is added to PATH, as I'm able to run that command from the same working directory as the gulpfile in Windows Shell without any problems. I can also run other commands correctly, like 'ls', 'pwd', 'npm --version', etc but for some reason it doesn't recognize 'karma'.
I have also gotten this running on OSX properly, so it's an issue local to my machine. Any help would be appreciated.
gulp.task('run-karma', shell.task(['karma start karma.conf.js']));
error is
'karma' is not recognized as an internal or external command,
operable program or batch file.
Error in plugin 'gulp-shell' Message:
Command 'karma start karma.conf.js' failed with exit code 1

Related

'tsc' is not recognized as an internal or external command, operable program or batch file. - Windows 7

I'm new here to Typescript and I'm trying to install it globally on my machine.
I currently have the following versions:
Node v.11.13.0
npm v6.7.0
When I run npm install -g typescript I get the following results:
C:\Users[userid].node_modules_global\tsc ->
C:\Users[userid].node_modules_glob al\node_modules\typescript\bin\tsc
C:\Users[userid].node_modules_global\tsserver ->
C:\Users[userid].node_modules
_global\node_modules\typescript\bin\tsserver
+ typescript#3.4.2 updated 1 package in 3.297s
The moment I run tsc or tsc -v on my command line, I receive the
'tsc' is not recognized as an internal or external command, operable
program or batch file.
I have uninstalled node and reinstalled it, but I still get the same error.
I have consulted Google and followed other methods on Stackoverflow to fix this problem, including checking the PATH folder structure.
I am not sure what I am doing wrong here, please help.
FYI I am running a Windows 7 PC.
In your command prompt, try executing the below command,
set path=%PATH%;c:\Users\YOUR_USER_DIRECTORY\AppData\Roaming\npm;
Then try executing your tsc command again, you will get it executed now.
Hope this helps!
FOUND IT!
Ok so I dug around and discovered the following:
Under User\[pc_name]\.node_modules_global I found the tsc and tsc.mcd files. All I did was copy those two files across to ...\Roaming\npm.
After doing that I ran tsc in my command prompt and it worked!

Fly command won't work after installing flight plan

So I was working through a tutorial to deploy my node app to a server. They had me npm install flightplan -g so I can use the 'fly' command. This all worked but for the fly command to work I needed to install rsync. I finally got rsync to work after changing my PATH. But now when I use to fly command I get "'fly' is not recognized as an internal or external command,
operable program or batch file."
I've tried changing the PATH hundreds of times to different things and I can't for the life of my get the fly command to work again. I've tried reinstalling flightplan globally a bunch of times. NOTHING IS WORKING.
Node JS NPM modules installed but command not recognized
This was the answer I was looking for.. I had the end of my path set to npm/fly and not just npm....

node command line module commands are not working Windows 8

So I'm having a lot of trouble getting my node module command line commands to run correctly.
For example if I try and run gulp I get a
>gulp
'gulp' is not recognized as an internal or external command,
operable program or batch file.
So I have tried making my environment variable NODE_PATH
%APPDATA%\npm\node_modules\
%APPDATA%\npm\node_modules
%APPDATA%\npm
but none of these seem to work. The only command I can use to get my gulp to run with is
C:\Users\Aaron\Documents\GitHub\2015fallTeam14>node %NODE_PATH%gulp\bin\gulp
[12:10:32] Using gulpfile ~\Documents\GitHub\2015fallTeam14\gulpfile.js
It would appear that cmd is not running my node with my NODE_PATH variable along with my command, but I do not know how to to fix this
You need to set the system PATH variable to tell the command prompt where to find gulp.bat (which npm creates).
This has nothing to do with Node itself.
I had add the following
Edit "PATH" environment variable and add %APPDATA%\npm
from
https://stackoverflow.com/a/27295145/4249440
Im not sure why this works though. I would like to know how the cmd knows to run node on this file path.

How to pass parameters to node.js from Windows command line

I'm working in a node application that can be started like this from a Mac machine:
DEBUG=app.* ENVIRONMENT=local node server/index.js
However, when trying to run that script in a Windows command line, I get the following message:
" 'DEBUG' is not recognized as an internal or external command, operable program or batch file."
When running the script without the parameters, I don't get any error.
How can I pass said parameters to my index.js from Windows?
Run this in the CMD window where you'll run your node app.
SET DEBUG=app.*
SET ENVIRONMENT=local
node server/index.js
Or if you want it to be in a single line, type this.
SET DEBUG=app.*&&SET ENVIRONMENT=local&&node server/index.js
To make this variable changes persistent, you should edit your environment variables in control panel.

I can't run test with "vows test/*" command on windows. How to use it? node.js

I've installed vows as module of my project and I've added the path "node_modules\vows\bin" to my environment path variable of windows vista.
note: I've also renamed "node_modules\vows\bin\vows" to vows.exe, because without the extension I get this error: 'vows' is not recognized as an internal or external command,
operable program or batch file.
Now wherever I put "vows" in my cmd in windows nothing happens, I cd into my test folder and I run "vows myFirstTest.js" and nothing happens. (when I say nothing happens my cursor in cmd is going to the top and then return to it's original position and it's doing this forever, therefore each time I try a vows command in cmd I have to close the cmd to run another command).
What I'm doing bad?
thanks
NPM is great at globally installing packages and making the executable for each operating system (UNIX-ish + Windows), so proceed with the following:
npm install -g vows

Resources