timecut icon indicating copy to clipboard operation
timecut copied to clipboard

Error: EACCES: permission denied, mkdir '/path'

Open micahstubbs opened this issue 7 years ago • 8 comments

when I run this command:

timecut https://bl.ocks.org/micahstubbs/3f439df92579c5bb2902fab15742ba87 --selector "iframe" --left 1 --right 1 --top 1 --bottom 1 --duration=120 --output=/path/to/output/video.mp4

I see this error in the terminal:

[0922/163349.098134:ERROR:gpu_process_transport_factory.cc(1043)] Lost UI shared context.

DevTools listening on ws://127.0.0.1:61493/devtools/browser/1c5d40b3-3f48-4d35-b490-4977aa179363
Going to https://bl.ocks.org/micahstubbs/3f439df92579c5bb2902fab15742ba87...
[0922/163350.219793:INFO:CONSOLE(4)] "graph", source: https://bl.ocks.org/micahstubbs/raw/3f439df92579c5bb2902fab15742ba87/6d432e10e85c9d21497ac7d44ddc85a1bcda64f1/vis.js (4)
[0922/163350.225464:INFO:CONSOLE(49)] "clusters", source: https://bl.ocks.org/micahstubbs/raw/3f439df92579c5bb2902fab15742ba87/6d432e10e85c9d21497ac7d44ddc85a1bcda64f1/vis.js (49)
Page loaded
{ Error: EACCES: permission denied, mkdir '/path'
    at Object.fs.mkdirSync (fs.js:902:18)
    at makeFileDirectoryIfNeeded (/Users/m/.config/yarn/global/node_modules/timesnap/index.js:211:10)
    at /Users/m/.config/yarn/global/node_modules/timesnap/index.js:374:15
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7) errno: -13, code: 'EACCES', syscall: 'mkdir', path: '/path' }
{ Error: EACCES: permission denied, mkdir '/path'
    at Object.fs.mkdirSync (fs.js:902:18)
    at makeFileDirectoryIfNeeded (/Users/m/.config/yarn/global/node_modules/timecut/index.js:45:10)
    at makeProcessPromise (/Users/m/.config/yarn/global/node_modules/timecut/index.js:116:5)
    at /Users/m/.config/yarn/global/node_modules/timecut/index.js:176:16
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:182:7) errno: -13, code: 'EACCES', syscall: 'mkdir', path: '/path' }

micahstubbs avatar Sep 22 '18 23:09 micahstubbs

maybe this is related to this global install step? 🤔 https://github.com/tungs/timecut#cli-global-install

micahstubbs avatar Sep 22 '18 23:09 micahstubbs

to install, I ran the command yarn global add timecut

micahstubbs avatar Sep 22 '18 23:09 micahstubbs

let's try

yarn global remove timecut

and then follow the instructions here https://docs.npmjs.com/getting-started/fixing-npm-permissions#option-two-change-npms-default-directory

and then

npm install -g timecut

micahstubbs avatar Sep 22 '18 23:09 micahstubbs

huh, after doing these steps, I still see the error. weird. running on

MacOS 10.13.6 node v9.11.1 npm 6.4.1

micahstubbs avatar Sep 22 '18 23:09 micahstubbs

Thanks for filing this issue! It looks like you don't have access to write to /path/to/output/video.mp4 (which I should have been more clear that it isn't really meant to be literal). Can you try video.mp4 instead?

timecut https://bl.ocks.org/micahstubbs/3f439df92579c5bb2902fab15742ba87 --selector "iframe" --left 1 --right 1 --top 1 --bottom 1 --duration=120 --output=video.mp4

It should output it into your current working directory as video.mp4. Let me know if it doesn't work. Thanks!

tungs avatar Sep 24 '18 07:09 tungs

I just noticed that since you don't use a border on your block, it's unnecessary to crop by one pixel in every direction. The tutorial uses it so the dimensions come out to 960x500, but in your case it'll crop out an additional pixel in each direction so it'll be 958x498.

So it simply can be something like: timecut https://bl.ocks.org/micahstubbs/3f439df92579c5bb2902fab15742ba87 --selector "iframe" --duration=120 --output=video.mp4

I should also add to others finding this page, that this issue references this timecut tutorial of recording d3 blocks.

tungs avatar Sep 24 '18 15:09 tungs

I'm marking this as an enhancement issue: when using an output path where the user doesn't have permission, there should be a clearer error than an EACCES error.

tungs avatar Sep 24 '18 15:09 tungs

nice, thanks for the response @tungs

I'll summarize what I read 😄

  1. user error on the path supplied
  2. edge case with blocks that have to border - user can omit crop arguments/flags
  3. possible enhancement to give better error message and / or prompt the user to supply a valid path

micahstubbs avatar Sep 24 '18 17:09 micahstubbs