Revert "修复:移除 .npm 卷挂载,解决 npm 缓存权限问题"

This reverts commit 2da736aaf3.
This commit is contained in:
2026-05-30 09:42:23 +08:00
parent 2da736aaf3
commit 43d3dbde2c
Vendored
+5 -2
View File
@@ -10,11 +10,13 @@ pipeline {
agent {
docker {
image 'node:20-alpine'
args '-v ${WORKSPACE}/node_modules:/app/node_modules'
args '-u root -v ${WORKSPACE}/.npm:/.npm -v ${WORKSPACE}/node_modules:/app/node_modules'
}
}
steps {
sh '''
npm config set cache /.npm
chown -R $(id -u):$(id -g) /.npm 2>/dev/null || true
npm install
'''
}
@@ -24,11 +26,12 @@ pipeline {
agent {
docker {
image 'node:20-alpine'
args '-v ${WORKSPACE}/node_modules:/app/node_modules'
args '-u root -v ${WORKSPACE}/.npm:/.npm -v ${WORKSPACE}/node_modules:/app/node_modules'
}
}
steps {
sh '''
chown -R $(id -u):$(id -g) /.npm 2>/dev/null || true
npm run type-check
npm run build
'''