pdf-parse is not found: EACCES: permission denied, open '/opt/backendless/repo/eee25b20-17fa-97dd-ff29-ec45a5072a00/files/servercode/node_modules/pdf-parse/index.js
I granted all the permissions to all the new folders and am still getting the error.
This issue isn’t related to Backendless permissions — it’s about OS-level file permissions. It looks like the files you uploaded from your local machine have restricted access.
To fix this, run the following command on your local machine:
chmod -R 644 /path/to/node_modules/pdf-parse
This makes all files readable and writable by the owner and readable by everyone else.
Once done, re-upload the files — Backendless should then be able to access them without any issues.
Looks like index.js in this library written by you?
if (isDebugMode) {
let PDF_FILE = './test/data/05-versions-space.pdf';
let dataBuffer = Fs.readFileSync(PDF_FILE);
Pdf(dataBuffer).then(function(data) {
Fs.writeFileSync(`${PDF_FILE}.txt`, data.text, {
encoding: 'utf8',
flag: 'w'
});
debugger;
}).catch(function(err) {
debugger;
});
}
Pay attention to “./test/data/05-versions-space.pdf” - it’s relative path and it will be calculated not from place where file located, but from place where we run the process. Add more logs and debug, potentially we can’t find this file and this is why we catch error.
I did not write any of the files; they came from installing the packages. To be honest, I don’t know what I’m doing. I am trying to follow @mark-piller’s instructions on using NPM modules.
I managed to find a workaround for the permissions issue (tested on macOS) while we investigate this incident. For now, try adding the required modules to a ZIP archive and drag-and-drop it into the Backendless file system. Once uploaded, extract the files directly there.