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

create-elm-app fails on attempt to copy read-only tempalte folder #598

Open
ony opened this issue Aug 22, 2021 · 0 comments
Open

create-elm-app fails on attempt to copy read-only tempalte folder #598

ony opened this issue Aug 22, 2021 · 0 comments

Comments

@ony
Copy link

ony commented Aug 22, 2021

Is this a bug report?

Yes

Environment

  1. nix shell 'nixpkgs#'nodejs --command node -v: v14.17.0
  2. nix shell 'nixpkgs#'nodejs --command npm -v: 6.14.13
  3. npm ls create-elm-app -g (if you haven’t ejected): N/A (use NixOS installation)

Then, specify:

  1. Operating system: NixOS 21.05.20210622.20d353f
  2. Browser and version (if relevant):

Steps to Reproduce

  1. nix shell 'nixpkgs#'{nodejs,elmPackages.create-elm-app} --command create-elm-app xyz
Creating xyz project...

Error: EACCES: permission denied, copyfile '/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/template/README.md' -> '/tmp/xyz/README.md'
    at Object.copyFileSync (fs.js:2059:3)
    at copyFile (/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/node_modules/fs-extra/lib/copy-sync/copy-sync.js:68:8)
    at onFile (/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/node_modules/fs-extra/lib/copy-sync/copy-sync.js:52:41)
    at getStats (/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/node_modules/fs-extra/lib/copy-sync/copy-sync.js:47:39)
    at startCopy (/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/node_modules/fs-extra/lib/copy-sync/copy-sync.js:37:10)
    at copyDirItem (/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/node_modules/fs-extra/lib/copy-sync/copy-sync.js:134:10)
    at /nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/node_modules/fs-extra/lib/copy-sync/copy-sync.js:127:39
    at Array.forEach (<anonymous>)
    at copyDir (/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/node_modules/fs-extra/lib/copy-sync/copy-sync.js:127:23)
    at mkDirAndCopy (/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/node_modules/fs-extra/lib/copy-sync/copy-sync.js:123:10) {
  errno: -13,
  syscall: 'copyfile',
  code: 'EACCES',
  path: '/nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/template/README.md',
  dest: '/tmp/xyz/README.md'
}

Expected Behavior

Folder with name xyz will be created with stub content for new project.

Actual Behavior

Empty folder with read-only permissions created only.

ls -lnd xyz
dr-xr-xr-x 2 1000 1000 4096 Aug 22 22:12 xyz

(notic first octet dr-x instead of drwx)

Note that permissions of original template folder in NixOS store also read-only

dr-xr-xr-x 1 0 0 80 Jan  1  1970 /nix/store/4wh8s09zfibsdpzjksy6zdzi53nklviv-node_create-elm-app-5.22.0/lib/node_modules/create-elm-app/template/

Reproducible Demo

N/A (issue with project creation 😉 : )


This seems to an issue jprichardson/node-fs-extra#629 which was closed in Feb 2020 , but create-elm-app still uses fs-extra 6.0.1 from May 2018, apparently.

"fs-extra": "6.0.1",

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

1 participant