From nobody Thu Jun 06 15:04:33 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vw70N5B8Mz5Mtw9 for ; Thu, 06 Jun 2024 15:04:36 +0000 (UTC) (envelope-from dale@dalescott.net) Received: from relay.b.hostedemail.com (smtprelay0241.b.hostedemail.com [64.98.42.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vw70M6ZYxz4HJJ for ; Thu, 6 Jun 2024 15:04:35 +0000 (UTC) (envelope-from dale@dalescott.net) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=dalescott.net header.s=key1 header.b=hIex8xZ6; dmarc=none; spf=pass (mx1.freebsd.org: domain of dale@dalescott.net designates 64.98.42.241 as permitted sender) smtp.mailfrom=dale@dalescott.net Received: from omf08.b.hostedemail.com (omf08 [10.200.6.71]) by unirelay02.b.hostedemail.com (Postfix) with ESMTP id 93C04A06A6 for ; Thu, 6 Jun 2024 15:04:34 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: dale@dalescott.net) by omf08.b.hostedemail.com (Postfix) with ESMTPA id 7CFF340006 for ; Thu, 6 Jun 2024 15:04:33 +0000 (UTC) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 Date: Thu, 06 Jun 2024 09:04:33 -0600 From: Dale Scott To: freebsd-questions@freebsd.org Subject: npm fails "Error: EACCES: permission denied, mkdir '/tmp/tryton/..." Message-ID: <6b36bd5900752353fd25f9cf102f1069@dalescott.net> X-Sender: dale@dalescott.net Organization: dalescott.net Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspamout07 X-Stat-Signature: qe8a73ykn6witp3oyq7rusq8u44kkrtc X-Spam-Status: No, score=-4.90 X-Session-Marker: 64616C654064616C6573636F74742E6E6574 X-Session-ID: U2FsdGVkX1+HYTporPQOdMBB0oAKlc38i7P2Tu/M+ak= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dalescott.net; h=mime-version:date:from:to:subject:message-id:content-type:content-transfer-encoding; s=key1; bh=LYRNEFkm7tdoSu111XE1whAHQxlYe1g9/3pU5ypfzsc=; b=hIex8xZ6PwGDGlwim3i7MvMVSWynZ5SInFZeXkwktCCPQdLhoAQoxbMWqsSRTj2WmZBR/rBOleSz8lvhNLlL1LvO85Sr4ObcPHOB9RUCYutFHm1LRn+DSmTczEATIFejTupBTsFgWvTVfouuL7O5Krf15PN49LuYlrEa/KWc3yo= X-HE-Tag: 1717686273-78038 X-HE-Meta: U2FsdGVkX19ttHfjCgT9jC9TC7xSuOV/3h9M76Tu9MAmdpiRpG9r3Za/G4H0NjfbFgbkT0ourclfqabfwypNmZPa4GT68GSSxl4AssJOzz3kElRdzkNxlDzQOhyJEbE4uNampV3q0RSSzx0H3Ahzc4FPb5Bt/LskE09b0rkzU2wi8h95scI3FD6Qs41S/WRbKzHrGBi57f51do1soz3ivNzJnBIF+BPi2Jz5Bq5WorROkgf+LkUa/LU/EK5JJ7GK6/lvcScmpLnzAOOtpjgr3LLZwoUko2OwQHOjk0nKAXaYnsd/qYAPrUFUa9eyzWsZBcDSAPPjL411oMYLEzQxNcAfgsS+tkhXKjMIYRkc9HDkNfILwkyIsgG/NLU4maasymy4RAq9GtVGr+SabmpCgpKekbv82rHjsjcK8pK7HzS1GTUKzNx1euhP6x8JNXMTlhNKeQhmaG4Xry8csEAtXKmLnZAoNt4jCVKUOxqAm4fbKjHDqqGqqLbzXHznbE1JRD/mp0kvgxPSoyXpTv9IeaS1mTo2JMBlZS5FbdrqFxyEHkcF5NsoQg== X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[dalescott.net:s=key1]; R_SPF_ALLOW(-0.20)[+ip4:64.98.42.0/24]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:32491, ipnet:64.98.32.0/20, country:CA]; MIME_TRACE(0.00)[0:+]; HAS_ORG_HEADER(0.00)[]; MISSING_XM_UA(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DMARC_NA(0.00)[dalescott.net: no valid DMARC record]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; DKIM_TRACE(0.00)[dalescott.net:+] X-Rspamd-Queue-Id: 4Vw70M6ZYxz4HJJ Hi all, I'm using npm to build an application (tryton-sao, the web client for Tryton ERP) and it fails when run as a regular user because of being unable to create a sub-directory in /tmp/, although the permissions on /tmp look ok to me. Running npm as root using sudo successfully completes, although npm issues warnings that using sudo is not necessary, not recommended, and that I should fix my system. From my notes, I was able to successfully run npm as a regular user in May 2022 (FreeBSD-13.0), and I first found I needed to run npm using sudo in Feb 2024 (FreeBSD-14.0) Fwiw, I've also posted to the Forum presuming mailing lists users aren't often forum users. https://forums.freebsd.org/threads/npm-fails-error-eacces-permission-denied-mkdir-tmp-tryton.93702/ Can anyone point me towards the likely cause and solution? I'm sure it will be obvious in hindsight. TIA! ## System dale@whizzer:~ % uname -a FreeBSD whizzer 14.0-RELEASE-p6 FreeBSD 14.0-RELEASE-p6 #0: Tue Mar 26 20:26:20 UTC 2024 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 dale@whizzer:~ % npm --version 10.5.1 dale@whizzer:~ % ## Permissions on /tmp dale@whizzer:~ % ll -d /tmp drwxrwxrwt 86 root wheel 1000 Jun 6 08:08 /tmp/ ## Failure running npm as regular user [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 ...... 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' ...... [tryton@whizzer ~/trytond/sao]$ ## Success running npm using sudo 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 ...... 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 % -- Dale Scott www.dalescott.net