traccar web app old version error

I downloaded the web project and put it in the traccar-web server path, but when I run the program, I get the following error
traccar-web-error.png

Anton Tananaev3 years ago

You need to run npm install.

When I execute this command, I encounter the following error, but I also encounter the same error with the administrator.

> /bin/bash -c 'mkdir -p web/lib/{ol,ol-layerswitcher,proj4,extjs} && cp node_modules/openlayers-dist/{ol.js,ol.css} web/lib/ol/ && cp node_modules/ol-layerswitcher/dist/{ol-layerswitcher.js,ol-layerswitcher.css} web/lib/ol-layerswitcher/ && cp node_modules/proj4/dist/proj4.js web/lib/proj4/ && cp node_modules/extjs-gpl/build/ext-all.js web/lib/extjs/ && mkdir -p web/lib/extjs/classic && cp -r node_modules/extjs-gpl/build/classic/locale web/lib/extjs/classic/locale && cp -r node_modules/extjs-gpl/build/classic/theme-triton web/lib/extjs/classic/theme-triton && mkdir -p web/lib/extjs/packages/charts && cp -r node_modules/extjs-gpl/build/packages/charts/classic web/lib/extjs/packages/charts/classic'

The system cannot find the path specified.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! traccar-web@ postinstall: `/bin/bash -c 'mkdir -p web/lib/{ol,ol-layerswitcher,proj4,extjs} && cp node_modules/openlayers-dist/{ol.js,ol.css} web/lib/ol/ && cp node_modules/ol-layerswitcher/dist/{ol-layerswitcher.js,ol-layerswitcher.css} web/lib/ol-layerswitcher/ && cp node_modules/proj4/dist/proj4.js web/lib/proj4/ && cp node_modules/extjs-gpl/build/ext-all.js web/lib/extjs/ && mkdir -p web/lib/extjs/classic && cp -r node_modules/extjs-gpl/build/classic/locale web/lib/extjs/classic/locale && cp -r node_modules/extjs-gpl/build/classic/theme-triton web/lib/extjs/classic/theme-triton && mkdir -p web/lib/extjs/packages/charts && cp -r node_modules/extjs-gpl/build/packages/charts/classic web/lib/extjs/packages/charts/classic'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the traccar-web@ postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\BagherNM\AppData\Roaming\npm-cache\_logs\2021-11-29T06_58_06_945Z-debug.log

and now localhost:8082 is <<404 - Not Found>>

I do not know why but all traccer-web content has been removed

Anton Tananaev3 years ago

Command is failing because the script requires bash.

it's true, I made it with the following command

npm config set script-shell bash

i have this error now,
traccar-web-error-2.png

Anton Tananaev3 years ago

Now if you want to run a release version you need to compile it first. You can do it with npm run build, but it requires sencha cmd.

I just need ui for viewing, testing and debugging my protocol in server. Do I have to build ui Or can I run it from intellij?

Anton Tananaev3 years ago

Yes, you should be able to.

I encounter the following error in localhost:8082 when i run it from intellij

Failed to load resource: the server responded with a status of 404 (Not Found) load.js.16

My problem was solved
I will post the steps step by step for future use

1-Download the web app and put it in the traccer-web server path
2-Execute the command npm install (If you encounter a bash error, the command Run the

npm config set script-shell bash 

and try again)
3- run Command

npm run build

(need cmd Sencha to run this command, and in case of error may be due to the configuration of the previous step, then delete the config with the following command

npm config delete script-shell bash

)
4-run server in intellij and see localhost:8082