Skip to content

Commit 076c8f6

Browse files
farfarfunclaude
andcommitted
fix(paperclip): unset npm_config_allow_scripts before invoking npx/npm
Works around a known npm bug (npm/cli#9783, #9912, #9968) where a user/global .npmrc allow-scripts setting leaks into child npm installs via npm_config_allow_scripts and gets misclassified as an explicit CLI flag, causing paperclipai's internal (project-scoped) install to fail with EALLOWSCRIPTS. Co-Authored-By: Claude Sonnet 5 <[email protected]>
1 parent b25003a commit 076c8f6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎scripts/services/paperclip/setup.sh‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
set -euo pipefail
66

7+
# 已知 npm bug(npm/cli#9783、#9912、#9968):用户/全局 .npmrc 中的 allow-scripts
8+
# 配置会被 npx/npm 以 npm_config_allow_scripts 环境变量形式透传给内部再次触发的
9+
# npm install(例如 paperclipai 安装器自身的依赖安装),而该内部安装是
10+
# project-scoped 的,npm 会误判为显式传入 --allow-scripts 并直接报错
11+
# EALLOWSCRIPTS。此处清除该环境变量,避免其被继承到子进程。
12+
unset npm_config_allow_scripts
13+
714
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
815
# shellcheck source=../../lib/fundeploy-common.sh
916
source "${SCRIPT_DIR}/../../lib/fundeploy-common.sh"

0 commit comments

Comments
 (0)