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

Primus->diagnostics->storage-engine forces --unsafe-perm in global install #754

Open
tkurki opened this issue Oct 26, 2019 · 4 comments
Open

Comments

@tkurki
Copy link

tkurki commented Oct 26, 2019

Version:
^7.3.3

Environment:

  • Linux

Expected result:
--unsafe-perm not needed

Actual result:
Global install with -g fails with

> storage-engine@3.0.7 postinstall /usr/lib/node_modules/signalk-server/node_modules/storage-engine
> node ./compatibility/detect.js

fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open '/usr/lib/node_modules/signalk-server/node_modules/storage-engine/lib/compatibility/index.js'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.writeFileSync (fs.js:1299:33)
    at /usr/lib/node_modules/signalk-server/node_modules/storage-engine/lib/compatibility/detect.js:35:15
    at Object.<anonymous> (/usr/lib/node_modules/signalk-server/node_modules/storage-engine/lib/compatibility/detect.js:45:3)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)

Steps to reproduce:
sudo npm install -g primus or for real add primus as a dependency and install your module with -g.

Filing the issue here for advice as to what to do about it, even if I understand that this is more a diagnostics / storage-engine issue. It seems that diagnostics is a "hard" dependency here, not something that you could just leave as optional.

@lpinca
Copy link
Member

lpinca commented Oct 26, 2019

Does it work if 01d04e1 is reverted?

@tkurki
Copy link
Author

tkurki commented Oct 28, 2019

Yes it does:

$ sudo npm install -g primus@7.3.2
+ primus@7.3.2
added 29 packages from 13 contributors in 10.094s
$ sudo npm install -g primus@7.3.3

> storage-engine@3.0.7 postinstall /usr/lib/node_modules/primus/node_modules/storage-engine
> node ./compatibility/detect.js

fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: EACCES: permission denied, open '/usr/lib/node_modules/primus/node_modules/storage-engine/lib/compatibility/index.js'

@lpinca
Copy link
Member

lpinca commented Oct 28, 2019

Ok, I think we can revert that commit then.

cc: @3rd-Eden

@tkurki
Copy link
Author

tkurki commented Oct 28, 2019

I wanted to bring this to your attention and get your feedback - this is not a showstopper, but something to be aware of. Maybe a better way to deal with it would be somewhere upstream.

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

2 participants