adapt_authoring icon indicating copy to clipboard operation
adapt_authoring copied to clipboard

npm install scripts for adapt_framework should run as root

Open oliverfoster opened this issue 4 years ago • 2 comments

Affected Area

Installation or update of AAT with upcoming Adapt Framework pr for issue/3169 won't finish if installed as a root user. This is as the submodules for Adapt Framework must be downloaded using the preinstall npm script executed with root permissions. The default npm scripts are run without root permissions when executed by root as default.

Requested Feature

Add --unsafe-perm=true to lib/installHelpers.js here https://github.com/adaptlearning/adapt_authoring/blob/bed716953161dad2ba0d2a076725eb31f25b983c/lib/installHelpers.js#L651

Use Case

  1. User updating an existing AAT.
  2. User installing a new AAT.

Current Workaround

Run sudo npm config set unsafe-perm true as root before updating or installing the AAT.

If run after a failed update or install. Run sudo npm install in the framework folder after running sudo npm config set unsafe-perm true.

Additional Information

https://geedew.com/What-does-unsafe-perm-in-npm-actually-do/

oliverfoster avatar Aug 04 '21 11:08 oliverfoster

Thanks for sharing a current workaround Oli.

Does this work globally if you have multiple Adapt servers on the same device? Or would you need to use the command in each directory before the upgrade command?

simondate avatar Sep 28 '21 08:09 simondate

It should do, sudo npm config set unsafe-perm true is a global config, I think.

oliverfoster avatar Sep 28 '21 08:09 oliverfoster