Unable to run node on cmd windows 7 - windows

C:\Windows\system32>echo %path%
C:\Program Files\Apache Software Foundation\apache-maven-3.2.2\bin";C:\Windows\S
ystem32;C:\Program Files (x86)\Heroku\bin;C:\Program Files\nodejs\;C:\Git\cmd;C:
\Git\bin;C:\Program Files\apache-ant-1.9.4\bin;C:\Program Files (x86)\Android\an
droid-studio\sdk\platform-tools;C:\Program Files (x86)\Android\android-studio\sd
k\tools;C:\Program Files\Java\jdk1.7.0_05\bin;C:\Program Files\Java\jdk1.7.0_05\
bin;
C:\Windows\system32>node
'node' is not recognized as an internal or external command,
operable program or batch file.

Set its installation directory path
SET PATH=C:\Program Files\Nodejs;%PATH%
and the module location path
C:\Users\AAhad\AppData\Roaming\npm;
and then on console run node
and check this as well: Node.js doesn't recognize system path?

Related

Can't add mongodb to PATH variable on windows 7

I tried to add the mongodb programs on my windows 7 latop to run a few programs I'm working on.
I added the mongodb path to the end of windows PATH variable in system properties / advanced. This is what I have:
C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\RSA SecurID Token Common;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Dell\Dell Data Protection\Encryption\;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\tdunphy\bin;C:\Python27;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%systemroot%\System32\WindowsPowerShell\v1.0\;C:\Python27\Scripts;C:\Users\tdunphy\bin\;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Skype\Phone;C:\Program Files\MongoDB\Server\3.4\bin
And when I try to run the mongo programs, this is what I get:
mongod' is not recognized as an internal or external command,
operable program or batch file.
mongo
'mongo' is not recognized as an internal or external command,
operable program or batch file.
What am I doing wrong?
I was facing the same situation moments ago. What I did was backup my PATH variable and put only the MongoDB path there. Restarted CLI and it worked. Then I added the deleted paths. Don't know why this worked.
By the way, 'mongodb' will not work, it's mongo or mongod depending what you want to call.

Tomcat is not working correctly, Why?

I have downloaded a binary version of tomcat server to my windows machine. After that I have unzipped it to C drive and set tomcat home and it's path as follows: -
TOMCAT_HOME = C:\Program Files\Apache\Tomcat\apache-tomcat-8.5.6
Path = C:\Program Files\Apache\Tomcat\apache-tomcat-8.5.6\bin
While I am trying to run it through command line as
catalina run
It gives the following error
The CATALINA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
Therefore I changed TOMCAT_HOME to CATALINA_HOME. In this case there is error but it gives following output
Using CATALINA_BASE: "C:\Program Files\Apache\Tomcat\apache-tomcat-8.5.6"
Using CATALINA_HOME: "C:\Program Files\Apache\Tomcat\apache-tomcat-8.5.6"
Using CATALINA_TMPDIR: "C:\Program Files\Apache\Tomcat\apache-tomcat-8.5.6\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_101"
Using CLASSPATH: "C:\Program Files\Apache\Tomcat\apache-tomcat-8.5.6\bin\bootstrap.jar;C:\Program Files\Apache\Tomcat\apache-tomcat-8.5.6\bin\tomcat-juli.jar"
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: C:\Program Files\Apache\Tomcat\apache-tomcat-8.5.6\logs\localhost_access_log.2016-10-17.txt (Access is denied)
... ... ...
... ... ...
I have 2 questions and those are: -
Is it mandatory to put CATALINA_HOME instead of TOMCAT_HOME?
How do I grant for access log file(s)?

Windows Command Prompt Change

I'm trying to follow this tutorial and part of it involves working in the Windows Command Prompt. I'm running Windows 7 on a 64 bit machine and running cmd.exe as an administrator. The issue is this line:
../nw/nw.exe app.nw
The file/folder dependency is like this:
myNodeWebkitApps
helloWorld
nw
Where nw.exe is located in folder nw and I am executing the line of code from hellowWorld. app.nw is located in the helloWorld folder. The error I recieve is '..' is not recognized as an internal or external command. Any thoughts on how to execute this would be helpful.
Use ..\nw\nw.exe app.nw (inverted slash, which is the Windows standard path separator).

Compiling Apache spark 1.1.0 on for localhost mode on windows 8 x64 PC? See specific errors

I've explicitly installed Java 8 SDK, Scala-IDE (modified eclipse), the normal Eclipse IDE, and sbt though not in that order. I don't really remember the order in which I installed those. I was sort of confused how to set up my environment variables when I have both the vanilla Eclipse IDE and Scala IDE's installed as opposed to just the command line tools, as these installations seem to organized the language environment differently that the command line installations do? So I wasn't what to point the variables to?
My understanding is that the CLASS_PATH environment variable is for user-defined classes, of which for my current project I have none. Beyond this. I have the following environment variable setup. I am on windows 8 x64.
SBT_HOME = C:\Program Files (x86)\sbt
JRE_HOME = C:\Program Files\Java\jre1.8.0_20
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_20
Path = %JRE_HOME%\bin;%JAVA_HOME%\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\scala\bin;C:\Program Files (x86)\sbt\bin;...(only relevant paths shown)
Upon downloading and extracting Apache Spark 1.1.0 and uncompressing it and entering into the uncompressed top level folder ~/(apache spark folder)/, and attempting to run sbt/sbt assembly of which I receive the following error using the cygwin command prompt.
[error] (streaming-flume-sink/compile:compile) java.io.IOException: Cannot run p
rogram "javac": CreateProcess error=2, The system cannot find the file specified
[error] (core/compile:compile) java.io.IOException: Cannot run program "javac":
CreateProcess error=2, The system cannot find the file specified
[error] Total time: 551 s, completed Oct 28, 2014 5:24:00 PM
So the error appeared to be that I can't run javac in cygwin. Well, I can't. So I tried the windows prompt as well, where my command javac actually works (since the enviro variables are setup.) And I get the following error when again attempting
`sbt/sbt assembly`.
C:\Program Files (x86)\spark-1.1.0>sbt\sbt assembly
'sbt\sbt' is not recognized as an internal or external command,
operable program or batch file.
>sbt/sbt assembly
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; sup
port was removed in 8.0
[info] Loading project definition from C:\Program Files (x86)\spark-1.1.0\project\projec
t
[info] Loading project definition from C:\Users\jim\.sbt\0.13\staging\ec3aa8f391
11944cc5f2\sbt-pom-reader\project
[warn] Multiple resolvers having different access mechanism configured with same
name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolve
rs (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Loading project definition from C:\Program Files (x86)\spark-1.1.0\project
[error] Expected symbol
[error] Not a valid command: /
[error] /sbt
[error] ^
but all kinds of variants of the same command don't work either, switching out slash types( sbt\sbt assembly).
I've also got spark in a folder that has no spaces: C:\Program Files (x86)\spark.
What in tarnation do I need to do to assemble/compile Spark?
Thanks a million.
Ran into the same problem in Windows8 and following steps fixed the issue
Create a folder which doesn't have space and copy over the content from Program Files/Java
Update the PATH and JAVA_HOME to the new path
Launch Cygwin and Try running javac command to make sure the environment variables are set properly
Though not related to this issue, Scala Installed directory should not have any space. I see that you have installed in Program Files

How to run bcp utility from root drive?

Machine does not have full sql server installed. but following distributable packages are installed on my machine:-
Microsoft® SQL Server® 2008 R2 Command Line Utilities
Microsoft® SQL Server® 2008 R2 Native Client
I have a batch file that runs bcp utility. If i run this batch file from the folder where bcp.exe is sitting (...tools\binn) it works.
but my dump question is if there is any way i can run this bcp utility from c:\ drive only. Right now if it run from c:\ drive it says:-
bcp is not recognized as an internal or external command,...
If you add the directory (...tools\binn) to your PATH variable or use the full path of the bcp executable this will work.
To add a directory to your PATH Control Panel > System > Advanced System Settings > Environment Variables.
Then find the Path Variable under system variables and add your bcp directory to the list (seperated by ;)
Just copy the bcp.exe from the other SQL Server or from respective SQL Server path
and copy it to batch file path, where you have your script.
While running the batch script, also please run from the same path in command line.

Resources