Building sao 7.0.11 by normal user fails

Hi all, building sao by a regular system user is failing for me since mid 6.8 (and including 7.0).

If I understand the error correctly, npm cannot create a directory under /tmp/, but the permissions on /tmp look ok to me.

Howeer, running npm as root (using sudo) succeeds and trytond with sao works correctly, although the install issues warnings that using sudo is not necessary and not recommended.

Has anyone encountered this before? Fwiw, the system is vanilla FreeBSD 14.0 with npm 10.5.1 and trytond and sao are being installed in a normal user home directory (user “tryton”).

Install by user tryton fails

[tryton@whizzer ~/trytond/sao]$ npm install --production --legacy-peer-deps
npm WARN config production Use `--omit=dev` instead.
npm WARN deprecated osenv@0.1.5: This package is no longer supported.
npm WARN deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm WARN deprecated glob@7.1.7: Glob versions prior to v9 are no longer supported

> tryton-sao@7.0.11 postinstall
> npx bower install

bower bootstrap#^3.3.7          cached https://github.com/twbs/bootstrap.git#3.4.1
bower bootstrap#^3.3.7        validate 3.4.1 against https://github.com/twbs/bootstrap.git#^3.3.7
bower qunit#^1.18               cached https://github.com/jquery/qunit.git#1.23.1
...<snip>...
bower Sortable#^1.8.4                                 resolve https://github.com/RubaXa/Sortable.git#^1.8.4
bower moment#^2.10                                     EACCES EACCES: permission denied, mkdir '/tmp/tryton/bower/673d4f049f0db3d188488f447477968a-75940-tGGj4Z'

Stack trace:
Error: EACCES: permission denied, mkdir '/tmp/tryton/bower/673d4f049f0db3d188488f447477968a-75940-tGGj4Z'

Permissions on /tmp

[tryton@whizzer ~/trytond/sao]$ ls -dl /tmp
drwxrwxrwt  86 root wheel 772 Jun  5 18:21 /tmp/

Install by root (sudo) is successful

dale@whizzer:/home/tryton/trytond/sao % sudo  npm install --production --legacy-peer-deps

npm WARN config production Use `--omit=dev` instead.

> tryton-sao@7.0.11 postinstall
> npx bower install

bower ESUDO         Please do not run with sudo

Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.

http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814

You can however run a command with sudo using "--allow-root" option
bower jquery#^3                 cached https://github.com/jquery/jquery-dist.git#3.7.1
bower jquery#^3               validate 3.7.1 against https://github.com/jquery/jquery-dist.git#^3
bower bootstrap#^3.3.7          cached https://github.com/twbs/bootstrap.git#3.4.1
...<snip>...

bootstrap#3.4.1 bower_components/bootstrap
└── jquery#3.7.1

jquery#3.7.1 bower_components/jquery

papaparse#5.4.1 bower_components/papaparse

c3#0.7.20 bower_components/c3
└── d3#5.16.0

gettext.js#0.7.0 bower_components/gettext.js

mousetrap#1.6.5 bower_components/mousetrap

moment#2.30.1 bower_components/moment

qunit#1.23.1 bower_components/qunit

Sortable#1.15.2 bower_components/Sortable

fullcalendar#3.10.5 bower_components/fullcalendar
├── jquery#3.7.1
└── moment#2.30.1

bootstrap-rtl-ondemand#3.3.4-ondemand bower_components/bootstrap-rtl-ondemand
└── bootstrap#3.4.1

d3#5.16.0 bower_components/d3

up to date, audited 137 packages in 5s

12 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New minor version of npm available! 10.5.1 -> 10.8.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.1
npm notice Run npm install -g npm@10.8.1 to update!
npm notice 
dale@whizzer:/home/tryton/trytond/sao %

For me this looks like a permission problem on your setup.

Found error was caused by /tmp/tryton/ already existed and directory owner was different than the user executing npm (the directory was presumably the result of an earlier sao install by a different user when I was sorting out the procedure).

The solution was to delete /tmp/tryton/

% sudo rm -r /tmp/tryton

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.