Error: EACCES: permission denied, mkdir '/path'
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' }
maybe this is related to this global install step? 🤔 https://github.com/tungs/timecut#cli-global-install
to install, I ran the command yarn global add timecut
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
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
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!
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.
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.
nice, thanks for the response @tungs
I'll summarize what I read 😄
- user error on the path supplied
- edge case with blocks that have to border - user can omit crop arguments/flags
- possible enhancement to give better error message and / or prompt the user to supply a valid path