npm ERR! `unsafe-perm` is not a valid npm option
Metadata
Current evaluation
npm plugin fails with npm >= 10 due to unsupported 'unsafe-perm' config. Issue is stale (1244 days old) and the problematic code has been removed from craft-parts.
Suggested action: close stale
Reason: The reported bug (npm config set unsafe-perm true causing errors with npm >= 10) has been resolved — the current craft-parts npm_plugin.py no longer contains any 'unsafe-perm' references and uses a different install strategy for npm >= 10. The issue is 1244 days old with no activity for 1075 days, making it stale and irrelevant.
Impact:
50
Quick Win:
35.0
Staleness:
90
Complexity:
30
Confidence:
70
Support Request:
10
Issue body
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/hello-node/install/ --no-same-owner --strip-components=1
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/.npm/_logs/2023-04-08T16_55_42_865Z-debug-0.log
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-include-node: true
npm-node-version: 18.15.0
=====
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://github.com/lool/hello-node-snap
Best,
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen3.6-35b-a3b-mtp-q6 |
Impact:
50
Quick Win:
35.0
Staleness:
90
Complexity:
30
Confidence:
70
Support Request:
10
|
close stale | npm plugin fails with npm >= 10 due to unsupported 'unsafe-perm' config. Issue is stale (1244 days old) and the problematic code has been removed from craft-parts. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
85
Complexity:
30
Confidence:
75
Support Request:
10
|
needs triage | Bug report regarding snapcraft's npm plugin using deprecated `unsafe-perm` config, causing build failures with Node 18+. Issue is unlabelled, has zero maintainer comments, and has been open for over 3 years. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
95
Complexity:
15
Confidence:
85
Support Request:
0
|
needs triage | npm plugin fails with recent npm versions due to deprecated unsafe-perm config command. Issue is untriaged, has no maintainer response, and has been inactive for nearly 3 years. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
90
Complexity:
20
Confidence:
85
Support Request:
10
|
needs triage | npm plugin fails on Node 18+ because unsafe-perm is no longer a valid npm config option. Issue is unlabelled, has zero comments, and has been inactive for nearly three years. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
95
Complexity:
20
Confidence:
75
Support Request:
5
|
needs triage | Bug report: npm plugin fails with modern npm versions because unsafe-perm is no longer a valid config option. Untriaged, inactive for ~2.7 years. |
Update history
No update history recorded yet.
Related issues
No related issues found above the similarity threshold.