# GenieACS Fails to start with Syntax Error

**URL:** <https://forum.genieacs.com/t/genieacs-fails-to-start-with-syntax-error/411>\
**Category:** Uncategorized\
**Created:** [October 30, 2019, 4:32pm UTC](https://forum.genieacs.com/t/genieacs-fails-to-start-with-syntax-error/411 "2019-10-30T16:32:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pobk](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/pobk/32/109_2.png) [@pobk](https://forum.genieacs.com/u/pobk)\
**Post date:** [October 30, 2019, 4:32pm UTC](https://forum.genieacs.com/t/genieacs-fails-to-start-with-syntax-error/411/1 "2019-10-30T16:32:23Z")

</div>

Hi,

I’ve been trying to get acs-1.2 to build and install in a way that I can tarball it and transplant it to a production server that doesn’t have access to NPM registries or other caches.

Unfortunately I keep running into various issues around NPM packaging, unsafe-permissions, invalid peer dependendencies, dependencies on old libraries (libxmljs2 etc)… or libraries that just aren’t available for FreeBSD.

A common one that I keep experiencing is a syntax error:

```
# /usr/local/genieacs/bin/genieacs-cwmp
/usr/local/genieacs/lib/node_modules/genieacs/bin/genieacs-cwmp:37
function exitWorkerGracefully(): void {
                               ^    

SyntaxError: Invalid or unexpected token
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)

```

Any advice and assistance would be appreciated.

~ Rich

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [October 31, 2019, 4:59am UTC](https://forum.genieacs.com/t/genieacs-fails-to-start-with-syntax-error/411/2 "2019-10-31T04:59:38Z")

</div>

Libxmljs is one of the main pain points for many users. Not necessarily because of problems in the library itself (although it hasn’t been updated in a long time) but because it’s a native dependency. Luckily it’s an optional dependency now (and will soon be removed entirely) so you can ignore installation errors pertaining to libxmljs. Actually, go ahead and remove it from package.json and try again.

As for the error you’re getting, it looks like you’re trying to run TypeScript code directly rather than transpile it to JS first. You need to run ‘npm run build’ first and the resulting ‘dist’ directly is what you want to copy to your production environment.
