From 3bd060817e1a78a0282841fff8bc653ac7aed6db Mon Sep 17 00:00:00 2001 From: chaxus Date: Wed, 14 Feb 2024 19:59:52 +0800 Subject: [PATCH] fix: remove tensorflow-tfjs-node cannot install in pnpm --- bin/clean.sh | 3 ++- packages/ml/bin/build.sh | 2 +- packages/ml/package.json | 2 +- packages/ml/readme.md | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 3 deletions(-) diff --git a/bin/clean.sh b/bin/clean.sh index d7167f846..d3eb89741 100644 --- a/bin/clean.sh +++ b/bin/clean.sh @@ -7,4 +7,5 @@ rm -rf packages/ranuts/node_modules/ rm -rf packages/docs/node_modules/ rm -rf packages/ranite/node_modules/ rm -rf packages/ml/node_modules/ -npm cache clean --force \ No newline at end of file +npm cache clean --force +rm -rf pnpm-lock.yaml \ No newline at end of file diff --git a/packages/ml/bin/build.sh b/packages/ml/bin/build.sh index 22f91273d..edabcac03 100644 --- a/packages/ml/bin/build.sh +++ b/packages/ml/bin/build.sh @@ -1,6 +1,6 @@ bin=./node_modules/.bin +cnpm install @tensorflow/tfjs-node # build es and splite bundle $bin/vite build -c ./config/build.es.ts # build umd -# TODO: splite bundle $bin/vite build -c ./config/build.umd.ts diff --git a/packages/ml/package.json b/packages/ml/package.json index 145e15485..289ba79b7 100644 --- a/packages/ml/package.json +++ b/packages/ml/package.json @@ -12,7 +12,7 @@ "dependencies": { "@ranui/react": "workspace:^", "@tensorflow/tfjs": "^4.16.0", - "@tensorflow/tfjs-node": "^4.16.0", + "@tensorflow/tfjs-node": "^4.17.0", "@tensorflow/tfjs-vis": "^1.5.1", "ranuts": "workspace:0.1.0-alpha.10", "react": "^18.2.0", diff --git a/packages/ml/readme.md b/packages/ml/readme.md index e69de29bb..eac4c7b48 100644 --- a/packages/ml/readme.md +++ b/packages/ml/readme.md @@ -0,0 +1,36 @@ + +# 查看ip地址 + +`https://tool.chinaz.com/speedtest/storage.googleapis.com` + +storage.googleapis.com 142.251.43.27 + +# Error + +```sh +node_modules/.pnpm/@tensorflow+tfjs-node@4.17.0/node_modules/@tensorflow/tfjs-node: Running install script, failed in 201ms +.../node_modules/@tensorflow/tfjs-node install$ node scripts/install.js +│ CPU-darwin-4.17.0.tar.gz +│ * Downloading libtensorflow +│ https://storage.googleapis.com/tf-builds/libtensorflow_r2_7_darwin_arm64_cpu.tar.gz +│ node:events:490 +│ throw er; // Unhandled 'error' event +│ ^ +│ Error: read ECONNRESET +│ at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) +│ Emitted 'error' event on ClientRequest instance at: +│ at TLSSocket.socketErrorListener (node:_http_client:496:9) +│ at TLSSocket.emit (node:events:512:28) +│ at emitErrorNT (node:internal/streams/destroy:151:8) +│ at emitErrorCloseNT (node:internal/streams/destroy:116:3) +│ at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { +│ errno: -54, +│ code: 'ECONNRESET', +│ syscall: 'read' +│ } +│ Node.js v19.6.0 +``` +- slove +```sh +cnpm install @tensorflow/tfjs-node +``` \ No newline at end of file