Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

ERROR: NodeJs script getting ENOTDIR when attempting fs.readdirSync - unable to set path to desired location

Not applicable

Running NodeJs script with the following:

var __dirname = '/opt/apigee4/data/apigee/custom_jars/gridjars'; var files = fs.readdirSync(__dirname);

Receiving the following error:

<faultstring>Script node executed prematurely: Error: ENOTDIR:/opt/apigee4/var/log/apigee/message-processor/work/o/Vasu/e/dev/a/TestArchGrid-D1__1/node/opt/apigee4/data/apigee/custom_jars/gridjars

It appears to be prepending the directory location where the API is running to whatever I try to assign as my jar location directory. I've tried relative path names, etc...but no matter what, the API root directory is added.

Thanks in advance for any help!

Solved Solved
0 3 6,105
1 ACCEPTED SOLUTION

@MikeHarris @vb878 pls refer to the answer here, i think they are related

Thanks,

View solution in original post

3 REPLIES 3