turboMaCk / bs-platform.nix

BuckleScript via nix made easy
4 stars 4 forks source link

permission denied error with nix-shell example #6

Open yokodake opened 3 years ago

yokodake commented 3 years ago

The shellHook in the nix-shell example fails with :

npm WARN checkPermissions Missing write access to /home/ngyj/source/tests/bs-tea-starter-kit/node_modules/bs-platform
npm WARN buckle@0.1.0 No description
npm WARN buckle@0.1.0 No repository field.

npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /home/ngyj/source/tests/bs-tea-starter-kit/node_modules/bs-platform
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/home/ngyj/source/tests/bs-tea-starter-kit/node_modules/bs-platform'
npm ERR!  [Error: EACCES: permission denied, access '/home/ngyj/source/tests/bs-tea-starter-kit/node_modules/bs-platform'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/home/ngyj/source/tests/bs-tea-starter-kit/node_modules/bs-platform'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ngyj/.npm/_logs/2020-12-03T11_03_18_535Z-debug.log

Either I need to run as root (which I'm not up to) or it tries write in that directory (which will never succeed since it's a symlink to the nix store).

turboMaCk commented 3 years ago

Are you sure the version of bs-platform your project depends on (in package.json) is the same version you install with nix? I think the error is npm/yarn trying to overwrite the symlink so effectively undo the nix install. This should not happen would the version be compatible I believe.