npm ERR! `unsafe-perm` is not a valid npm option
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Hi,
The npm plugin runs:
npm config set unsafe-perm true
during builds; this is not supported in recent npms and causes an error:
2023-04-08 16:55:43.386 :: 2023-04-08 16:55:41.117 :: + tar xzf - -C /root/parts/
2023-04-08 16:55:43.386 :: 2023-04-08 16:55:42.622 :: + npm config set unsafe-perm true
2023-04-08 16:55:43.386 :: 2023-04-08 16:55:42.882 :: npm ERR! `unsafe-perm` is not a valid npm option
2023-04-08 16:55:43.386 :: 2023-04-08 16:55:42.883 ::
2023-04-08 16:55:43.386 :: 2023-04-08 16:55:42.883 :: npm ERR! A complete log of this run can be found in:
2023-04-08 16:55:43.386 :: 2023-04-08 16:55:42.883 :: npm ERR! /root/.
This can be reproduced with a snapcraft.yaml such as:
=====
name: hello-node
base: core22
version: '1.0'
summary: Whatever
description: Whatever
grade: devel
confinement: devmode
parts:
hello-node:
plugin: npm
source: src
npm-
npm-
=====
With node-version 16.15.0, the build works; with node-version 18.15.0 it fails. 18.15.0 is the current upstream LTS node version, while the latest release is 19.8.1.
Here's a git repo with a sample hello world nodejs/npm snap:
https:/
Best,
Changed in snapcraft: | |
status: | New → Confirmed |