npm install windows-build-tols 时卡在 Successfully installed Python 2.7

博主遇到npm安装windows-build-tools时遇到Python环境等问题,尝试了多种方法,包括重装node.js,配置镜像加速等。最终通过在Temp文件夹新建dd_client_.log并添加特定内容解决了问题,成功安装Python2.7。

解决npm安装windows-build-tools时卡在Successfully installed Python 2.7

试了一整天,从开始的npm install显示error gpy,我以为是node.js版本问题,于是就去重装了node.js,然后试了各种方法,查阅了许多博客,最后在

https://blog.youkuaiyun.com/oqzuser1234asd/article/details/116169889?utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromMachineLearnPai2%7Edefault-1.base

在大哥的博客中找到了解决方法,我说说我的问题

问题再现

在这里插入图片描述

显示Python环境等一些问题
于是我通过配置镜像加速

npm install -g cnpm --registry=https://registry.npm.taobao.org

又运行

cnpm install --global --production windows-build-tools

运行一半。卡在了Successfully installed Python 2.7

如上面博客大佬所述,我找到我的Temp文件夹,可以在资源管理器中搜索"%temp%"就能找到。我的在资源管理器没找到,我就通过死办法,去我的Appdata目录里,找到Local,里面就有我们的Temp文件夹,在其中新建一个名为dd_client_.log的文件,在其中加入Closing installer. Return code: 3010. 后保存。就可以正常的执行npm install -g windows-build-tools

=> => transferring context: 77.36MB 0.8s3 => [base-image 2/8] RUN echo "deb https://mirrors.aliyun.com/debian/ bookworm main non-free contrib" > /etc/apt/sources.list && echo "deb https://mirrors.aliyun.co 0.6s => [stage-2 2/6] RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone 0.6s3 => [base-image 3/8] RUN apt-get update && apt-get install -y --no-install-recommends build-essential libssl-dev libffi-dev python3 60.6s => [stage-2 3/6] RUN rm -rf /app/superset/superset/static/dist 0.4s3 => [base-image 4/8] RUN apt-get remove -y nodejs npm || true 0.3s => [base-image 5/8] RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - 10.5s3 => [base-image 6/8] RUN apt-get update && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* 14.2s => [base-image 7/8] RUN corepack enable 0.3s3 => [base-image 8/8] RUN node --version && npm --version 0.3s => [frontend-builder 1/10] WORKDIR /app/superset-frontend 0.1s3 => [frontend-builder 2/10] COPY ./superset-5.0.0/superset-frontend/ . 0.5s => [frontend-builder 3/10] RUN ls -la && [ -f package.json ] || (echo "❌ Missing package.json!" && exit 1) && [ -f package-lock.json ] || (echo "❌ Missing 0.3s=> [frontend-builder 5/10] RUN --mount=type=cache,id=npm-node-modules,target=/app/superset-frontend/node_modules --mount=type=cache,id=npm-cache,target=/tmp/npm 167.9s => [frontend-builder 4/10] RUN npm config set registry https://registry.npmmirror.com && mkdir -p /tmp/npm-cache && npm config set cache /tmp/npm-cache 1.8s3 => [frontend-builder 5/10] RUN --mount=type=cache,id=npm-node-modules,target=/app/superset-frontend/node_modules --mount=type=cache,id=npm-cache,target=/tmp/npm 167.9s => [frontend-builder 6/10] RUN npm install --no-save webpack@5 webpack-cli@5 104.1s3 => [frontend-builder 7/10] RUN sed -i 's/cross-env/npx cross-env/g' package.json 1.6s => [frontend-builder 8/10] RUN echo "📁 Current directory:" && pwd && echo "📄 package.json exists:" && [ -f package.json ] && echo "✅" || echo "❌" && 3.2s => # > superset@5.0.0 build => ERROR [frontend-builder 9/10] RUN npm run build && echo "✅ Frontend built successfully" 1.1s ------ > [frontend-builder 9/10] RUN npm run build && echo "✅ Frontend built successfully": 0.326 0.326 > superset@5.0.0 build 0.326 > npx cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV="${BABEL_ENV:=production}" webpack --color --mode production 0.326 1.026 [webpack-cli] Failed to load '/app/superset-frontend/webpack.config.js' config 1.028 [webpack-cli] Error: Can not access zstd! Is it installed? 1.028 at Object.<anonymous> (/app/superset-frontend/node_modules/simple-zstd/index.js:15:9) 1.028 at Module._compile (node:internal/modules/cjs/loader:1521:14) 1.028 at Module._extensions..js (node:internal/modules/cjs/loader:1623:10) 1.028 at Module.load (node:internal/modules/cjs/loader:1266:32) 1.028 at Module._load (node:internal/modules/cjs/loader:1091:12) 1.028 at Module.require (node:internal/modules/cjs/loader:1289:19) 1.028 at require (node:internal/modules/helpers:182:18) 1.028 at Object.<anonymous> (/app/superset-frontend/webpack.proxy-config.js:20:28) 1.028 at Module._compile (node:internal/modules/cjs/loader:1521:14) 1.028 at Module._extensions..js (node:internal/modules/cjs/loader:1623:10) ------ Dockerfile.superset:129 -------------------- 128 | # 构建前端生产包 129 | >>> RUN npm run build && \ 130 | >>> echo "✅ Frontend built successfully" 131 | -------------------- failed to solve: process "/bin/sh -c npm run build && echo \"✅ Frontend built successfully\"" did not complete successfully: exit code: 2 gapinyc@DESKTOP-9QS7RL5:~/superset-prod$ \
10-24
=> [internal] load build context 0.7s => => transferring context: 77.36MB 0.6s => [stage-2 2/6] RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone 0.5s => [base-image 2/8] RUN echo "deb https://mirrors.aliyun.com/debian/ bookworm main non-free contrib" > /etc/apt/sources.list && echo "deb https://mirrors.aliyun.com/debian-security bookworm-security main non-free contrib" >> 0.5s => [stage-2 3/6] RUN rm -rf /app/superset/superset/static/dist 0.4s => [base-image 3/8] RUN apt-get update && apt-get install -y --no-install-recommends build-essential libssl-dev libffi-dev python3-dev libev-dev libjpeg-dev zlib1g-de 406.5s => [base-image 4/8] RUN apt-get remove -y nodejs npm || true 0.3s => [base-image 5/8] RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - 202.0s => [base-image 6/8] RUN apt-get update && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* 23.5s => [base-image 7/8] RUN corepack enable 0.3s => [base-image 8/8] RUN node --version && npm --version 0.3s => [frontend-builder 1/9] WORKDIR /app/superset-frontend 0.1s => [frontend-builder 2/9] COPY ./superset-5.0.0/superset-frontend/ . 0.4s => [frontend-builder 3/9] RUN ls -la && [ -f package.json ] || (echo "❌ Missing package.json!" && exit 1) && [ -f package-lock.json ] || (echo "❌ Missing package-lock.json!" && exit 1) 0.3s => [frontend-builder 4/9] RUN npm config set registry https://registry.npmmirror.com && mkdir -p /tmp/npm-cache && npm config set cache /tmp/npm-cache 1.7s => [frontend-builder 5/9] RUN --mount=type=cache,id=npm-node-modules,target=/app/superset-frontend/node_modules --mount=type=cache,id=npm-cache,target=/tmp/npm-cache npm ci 495.5s => [frontend-builder 6/9] RUN sed -i 's/cross-env/npx cross-env/g' package.json 0.4s => [frontend-builder 7/9] RUN echo "📁 Current directory:" && pwd && echo "📄 package.json exists:" && [ -f package.json ] && echo "✅" || echo "❌" && echo "📄 package-lock.json exists:" && [ -f package-lock.jso 0.6s => ERROR [frontend-builder 8/9] RUN npm run build && echo "✅ Frontend built successfully" 6.6s ------ > [frontend-builder 8/9] RUN npm run build && echo "✅ Frontend built successfully": 0.317 0.317 > superset@5.0.0 build 0.317 > npx cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV="${BABEL_ENV:=production}" webpack --color --mode production 0.317 1.430 npm warn exec The following package was not found and will be installed: cross-env@10.1.0 6.523 node:events:502 6.523 throw er; // Unhandled 'error' event 6.523 ^ 6.523 6.523 Error: spawn webpack ENOENT 6.523 at ChildProcess._handle.onexit (node:internal/child_process:285:19) 6.523 at onErrorNT (node:internal/child_process:483:16) 6.523 at process.processTicksAndRejections (node:internal/process/task_queues:82:21) 6.523 Emitted 'error' event on ChildProcess instance at: 6.523 at ChildProcess._handle.onexit (node:internal/child_process:291:12) 6.523 at onErrorNT (node:internal/child_process:483:16) 6.523 at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { 6.523 errno: -2, 6.523 code: 'ENOENT', 6.523 syscall: 'spawn webpack', 6.523 path: 'webpack', 6.523 spawnargs: [ '--color', '--mode', 'production' ] 6.523 } 6.523 6.523 Node.js v20.19.5 ------ Dockerfile.superset:127 -------------------- 126 | # 构建前端生产包 127 | >>> RUN npm run build && \ 128 | >>> echo "✅ Frontend built successfully" 129 | -------------------- failed to solve: process "/bin/sh -c npm run build && echo \"✅ Frontend built successfully\"" did not complete successfully: exit code: 1 gapinyc@DESKTOP-9QS7RL5:~/superset-prod$
10-23
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值