puppeteer-lambda-starter-kit
puppeteer-lambda-starter-kit copied to clipboard
Cannot cd into '/tmp'
In trying to setup local chome in this block,
const setupLocalChrome = () => {
return new Promise((resolve, reject) => {
fs.createReadStream(config.localChromePath)
.on('error', (err) => reject(err))
.pipe(tar.x({
C: config.setupChromePath,
}))
.on('error', (err) => reject(err))
.on('end', () => resolve());
});
};
I get this error, has anyone else bumped into this and found a good solution? I suppose I can chmod the /tmp directory but that seems like a hack.
Cwd Error ----------------------------------------------
ENOTDIR: Cannot cd into '/tmp'
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Stack Trace --------------------------------------------
CwdError: ENOTDIR: Cannot cd into '/tmp'
at CwdError (/Users/mark/dev/repos/spr-renderer/node_modules/tar/lib/mkdir.js:26:5)
at fs.lstat (/Users/mark/dev/repos/spr-renderer/node_modules/tar/lib/mkdir.js:74:14)
at FSReqWrap.oncomplete (fs.js:123:15)
I'm running into the same problem trying to run this locally. Did you find a solution?
I switched the code from:
.pipe(tar.x({
C: path.join(path.sep, 'tmp')
}))
to:
.pipe(tar.x({
C: path.join(process.cwd(), path.sep, 'tmp')
}))
and it worked (after creating tmp
directory in my application folder).
@MikeGertrudes I have got this worked in Lambda, for lambda usage, seems you shouldn't add that "process.cwd()".