So I'm trying to make a small script to run my tomcat server and do npm run serve
to start my vue project.
But here is the problem if I open CMD and and cd into the project then I can do npm run serve
and it does work but if I try to call it from a batch file it does not work. The vue app is in a folder called "test-app" Here are my batch files:
set CATALINA_HOME="C:\workspaces\apache-tomcat-8.5.39"
set PATH="%CATALINA_HOME%\bin"
set PATH=%APPDATA%\npm;%PATH%
start cmd /k call "C:\workspaces\apache-tomcat-8.5.39\bin\startup.bat"
start cmd /k call "test-app/webserver.bat"
webserver.bat:
cd test-app
call npm run serve
The tomcat server starts up all fine, but apparently this does not. here is the output:
C:\Users\Kenneth\Desktop\Start av servere>cd test-app
C:\Users\Kenneth\Desktop\Start av servere\test-app>call npm run serve
'npm' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Kenneth\Desktop\Start av servere\test-app>
I've also tried
cd test-app
start npm run serve
and
cd test-app
call npm run serve
aswell as
cd test-app
npm run serve