Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install error #261

Closed
hehehai opened this issue Jun 23, 2021 · 7 comments · Fixed by #263
Closed

install error #261

hehehai opened this issue Jun 23, 2021 · 7 comments · Fixed by #263

Comments

@hehehai
Copy link

hehehai commented Jun 23, 2021

cli yarn install secret-agent

env:
yarn: v1.22.5
node: v15.10.0

network location: chinese

[4/4] 🔨  Building fresh packages...
[-/12] ⡀ waiting...
[-/12] ⡀ waiting...
[11/12] ⡀ @secret-agent/mitm-socket
[-/12] ⡀ waiting...
error /.../server/node_modules/@secret-agent/mitm-socket: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /.../server/node_modules/@secret-agent/mitm-socket
Output:
ERROR downloading needed Secret Agent library https://github.com/ulixee/secret-agent/releases/download/v1.4.1-alpha.5/connect.checksum Error: socket hang up
    at connResetException (node:internal/errors:642:14)
    at TLSSocket.socketOnEnd (node:_http_client:486:23)
    at TLSSocket.emit (node:events:390:22)
    at endReadableNT (node:internal/streams/readable:1307:12)
    at processTicksAndRejections (node:internal/process/task_queues:81:21) {
  code: 'ECONNRESET'
}
node:internal/process/promises:245
          triggerUncaughtException(err, true /* fromPromise */);
          ^

Error: socket hang up
    at connResetException (node:internal/errors:642:14)
    at TLSSocket.socketOnEnd (node:_http_client:486:23)
    at TLSSocket.emit (node:events:390:22)
    at endReadableNT (node:internal/streams/readable:1307:12)
@hehehai
Copy link
Author

hehehai commented Jun 23, 2021

Do I need to set socket proxy?, Because of the network problem, the access to some information of GitHub in China often times out of time

@hehehai
Copy link
Author

hehehai commented Jun 23, 2021

When I have NPM image in China, cnpm is installed successfully

run: cnpm install secret-agent

env: cnpm --version

[email protected] (/usr/local/lib/node_modules/cnpm/lib/parse_argv.js)
[email protected] (/usr/local/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
[email protected] (/usr/local/bin/node)
[email protected] (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/usr/local
darwin x64 20.5.0
registry=https://r.npm.taobao.org
✔ Installed 1 packages
✔ Linked 101 latest versions
[1/4] scripts.postinstall [email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] run "node install", root: "/.../server/node_modules/_@[email protected]@@secret-agent/replay"
[1/4] scripts.postinstall [email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] finished in 106ms
[2/4] scripts.postinstall [email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] run "node install.js", root: "/.../server/node_modules/_@[email protected]@@secret-agent/mitm-socket"
Downloading Secret Agent connect library from https://github.com/ulixee/secret-agent/releases/download/v1.4.1-alpha.5/connect_1.4.1-alpha.5_mac_x86_64.gz (checksum=7b7441eb165ef796130c2138e989ea57db882e1f7d03c8a6d713d59c7f1ef495)
Successfully downloaded
[2/4] scripts.postinstall [email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] finished in 2m
[3/4] scripts.postinstall [email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] run "node install.js", root: "/.../server/node_modules/_@[email protected]@@secret-agent/emulate-chrome-88"
Chrome 88.0.4324.150 is already installed; skipping download.
[3/4] scripts.postinstall [email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] finished in 107ms
[4/4] scripts.install [email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] › better-sqlite3@^7.1.4 run "prebuild-install || npm run build-release", root: "/.../server/node_modules/[email protected]@better-sqlite3"
prebuild-install http request GET https://github.com/JoshuaWise/better-sqlite3/releases/download/v7.4.1/better-sqlite3-v7.4.1-node-v88-darwin-x64.tar.gz
prebuild-install http request Proxy setup detected (Host: 127.0.0.1, Port: 7890, Authentication: No) Tunneling with httpsOverHttp
prebuild-install http 404 https://github.com/JoshuaWise/better-sqlite3/releases/download/v7.4.1/better-sqlite3-v7.4.1-node-v88-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=15.10.0 runtime=node arch=x64 libc= platform=darwin)
npm http fetch GET 200 https://r.npm.taobao.org/npm 302ms

> [email protected] build-release
> node-gyp rebuild --release

  TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediatebao.org/npm 302ms
  ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
  TOUCH Release/obj.target/deps/locate_sqlite3.stampr.npm.taobao.org/npm 302ms
  CC(target) Release/obj.target/sqlite3/gen/sqlite3/sqlite3.o
  LIBTOOL-STATIC Release/sqlite3.ah GET 200 https://r.npm.taobao.org/npm 302ms
  CXX(target) Release/obj.target/better_sqlite3/src/better_sqlite3.o/npm 302ms
  SOLINK_MODULE(target) Release/better_sqlite3.node/r.npm.taobao.org/npm 302ms
  CC(target) Release/obj.target/test_extension/deps/test_extension.o/npm 302ms
  SOLINK_MODULE(target) Release/test_extension.node/r.npm.taobao.org/npm 302ms
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediatem.taobao.org/npm 302ms
[4/4] scripts.install [email protected] › @secret-agent/[email protected] › @secret-agent/[email protected] › better-sqlite3@^7.1.4 finished in 39s
✔ Run 4 scripts
peerDependencies WARNING [email protected] › @secret-agent/[email protected] › ws@^7.4.4 requires a peer of bufferutil@^4.0.1 but none was installed
peerDependencies WARNING [email protected] › @secret-agent/[email protected] › ws@^7.4.4 requires a peer of utf-8-validate@^5.0.2 but none was installed
Recently updated (since 2021-06-16): 1 packages (detail see file /.../server/node_modules/.recently_updates.txt)
✔ All packages installed (110 packages installed from npm registry, used 3m(network 1s), speed 170.97kB/s, json 102(249.96kB), tarball 0B)

@hehehai
Copy link
Author

hehehai commented Jun 23, 2021

const req = https.get(filepath, async res => {

I use HTTP in my shampoo environment_ proxy, https_ Proxy, but the request here is not used

nodejs/node#8381

@blakebyrnes
Copy link
Contributor

Hi @hehehai, yes it looks like we are missing the proxy configuration for downloading the mitm. Will need to fix this for you to be able to use it unless you can set a system proxy.

@hehehai
Copy link
Author

hehehai commented Jun 23, 2021

@blakebyrnes Yes, system proxy is indeed a problem, but if there is no proxy, network problems will affect the installation of dependency

Sorry, I'd like to ask why the dependent installation chooses this method of code download instead of NPM direct download. Is it because of the file size and update frequency?

I think the current way sometimes leads to errors or abnormal information without feedback. I don't know why, but it makes it difficult to debug the program

@blakebyrnes
Copy link
Contributor

I wish I knew a better option. There are 3 binaries compiled "per-system" that we generate (chrome, mitm, replay), and one that we include (better-sqlite3). The size is too big to put directly into an npm package with every architecture and platform.

At some point, you could more reliably see logs output from the program during npm runs, but now it seems to drown out most logging/output, which makes it hard to troubleshoot (I agree).

@blakebyrnes
Copy link
Contributor

You can get a sense for some of the assets involved here: https://github.com/ulixee/secret-agent/releases/tag/v1.4.1-alpha.5

Chrome is downloaded in a fashion similar to Puppeteer and Playwright. They don't seem to have found a better way (beyond looking for correct proxy settings, which I'm fixing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants