NodeJS SDK config directory

When I call the following command

await ziti_init(process.argv[1]);

I get the following error..

what is unusual is the highlighted directory

@ff5bc3e(main) starting at (2022-06-06T11:05:02.557)
[ 0.000] ERROR ziti-sdk:model_support.c:67 parse_tokens() jsmn_parse() failed: -2
[ 0.000] ERROR ziti-sdk:ziti.c:216 ziti_init_opts()

/Users/runner/work/ziti-sdk-nodejs/ziti-sdk-nodejs/deps/ziti-sdk-c/library /ziti.c:186 - load_config(options->config, &cfg) => -13 (Configuration is invalid)

This is not the folder the app is being run from.

Any tips

@curt

hmm think I need to run the build process... will give it a go

yep.. that seems to be the source... but created a lot of errors

Any tips on how to set the npm package properly to run the build process

ziti-sdk-nodejs@0.4.0 build /Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers

npm run build:init; npm run build:c-sdk; npm install --build-from-source --clang=1

ziti-sdk-nodejs@0.4.0 build:init /Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers

git submodule update --init --recursive

fatal: not a git repository (or any of the parent directories): .git

npm ERR! code ELIFECYCLE

npm ERR! errno 128

npm ERR! ziti-sdk-nodejs@0.4.0 build:init: git submodule update --init --recursive

npm ERR! Exit status 128

npm ERR!

npm ERR! Failed at the ziti-sdk-nodejs@0.4.0 build:init script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

ziti-sdk-nodejs@0.4.0 build:c-sdk /Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers

cd deps/ziti-sdk-c; git submodule update --init --recursive; mkdir build; cd build; cmake -G Ninja -DCMAKE_POSITION_INDEPENDENT_CODE=ON --config Debug ..; cmake --build . --target all

sh: line 0: cd: deps/ziti-sdk-c: No such file or directory

fatal: not a git repository (or any of the parent directories): .git

mkdir: build: File exists

CMake Error: The source directory "/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/build/Debug" does not exist.

Specify --help for usage, or press the help button on the CMake GUI.

Error: could not load cache

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! ziti-sdk-nodejs@0.4.0 build:c-sdk: cd deps/ziti-sdk-c; git submodule update --init --recursive; mkdir build; cd build; cmake -G Ninja -DCMAKE_POSITION_INDEPENDENT_CODE=ON --config Debug ..; cmake --build . --target all

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the ziti-sdk-nodejs@0.4.0 build:c-sdk script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

ziti-sdk-nodejs@0.4.0 install /Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers

node-pre-gyp install --fallback-to-build

gyp: binding.gyp not found (cwd: /Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers) while trying to load binding.gyp

gyp ERR! configure error

gyp ERR! stack Error: gyp failed with exit code: 1

gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)

gyp ERR! stack at ChildProcess.emit (events.js:400:28)

gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)

gyp ERR! System Darwin 21.4.0

gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/build/Release/node-v83-darwin-x64/ziti_sdk_nodejs.node" "--module_name=ziti_sdk_nodejs" "--module_path=/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/build/Release/node-v83-darwin-x64" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"

gyp ERR! cwd /Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers

gyp ERR! node -v v14.19.3

gyp ERR! node-gyp -v v5.1.0

gyp ERR! not ok

node-pre-gyp ERR! build error

node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/build/Release/node-v83-darwin-x64/ziti_sdk_nodejs.node --module_name=ziti_sdk_nodejs --module_path=/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/build/Release/node-v83-darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)

node-pre-gyp ERR! stack at ChildProcess. (/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)

node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28)

node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1088:16)

node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)

node-pre-gyp ERR! System Darwin 21.4.0

node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"

node-pre-gyp ERR! cwd /Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers

node-pre-gyp ERR! node -v v14.19.3

node-pre-gyp ERR! node-pre-gyp -v v1.0.9

node-pre-gyp ERR! not ok

Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/build/Release/node-v83-darwin-x64/ziti_sdk_nodejs.node --module_name=ziti_sdk_nodejs --module_path=/Users/houst/DevTech/ _zitiapps/ZAC dark/first-servers/build/Release/node-v83-darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! ziti-sdk-nodejs@0.4.0 install: node-pre-gyp install --fallback-to-build

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the ziti-sdk-nodejs@0.4.0 install script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! ziti-sdk-nodejs@0.4.0 build: npm run build:init; npm run build:c-sdk; npm install --build-from-source --clang=1

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the ziti-sdk-nodejs@0.4.0 build script.

npm ERR! This is probabl