Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot cd into '/tmp' #4

Open
md97212 opened this issue Oct 29, 2017 · 3 comments
Open

Cannot cd into '/tmp' #4

md97212 opened this issue Oct 29, 2017 · 3 comments

Comments

@md97212
Copy link

md97212 commented Oct 29, 2017

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)
@ThePaulMcBride
Copy link

I'm running into the same problem trying to run this locally. Did you find a solution?

@MikeGertrudes
Copy link

MikeGertrudes commented Apr 2, 2018

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).

@conanmy
Copy link

conanmy commented Jun 29, 2018

@MikeGertrudes I have got this worked in Lambda, for lambda usage, seems you shouldn't add that "process.cwd()".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants