Skip to content

Yarn installation fails incompatible engine 'node'  #4415

Closed

Description

@Justxd22

OS/Web Information

  • Web Browser: ~
  • Local OS: Android q aarch64 (arm64)
  • Remote OS: ~
  • Remote Architecture: ~
  • code-server --version: latest

Steps to Reproduce

  1. Latest termux version
  2. apt update && apt upgrade && apt install build-essential python git nodejs-lts yarn

3.yarn global add code-server

Expected

Install?

Actual

yarn complains about nodejs version expected v14 (the old lts)
The problem is the nodejs-lts is now v16 how can i get v14? Should I go with the standalone install?

Screenshot

Screenshot_20211029_232247

Activity

  1. Justxd22 commented on Oct 29, 2021

    @Justxd22
    Author

    edit :

    Using the ignore engines flag :

    yarn global add code-server --ignore-engines
    yarn global v1.22.15
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    [3/4] Linking dependencies...
    warning "code-server > @coder/logger@1.1.16" has unmet peer dependency "@google-cloud/logging@^4.5.2".
    [4/4] Building fresh packages...
    [1/3] ⠠ argon2
    [-/3] ⠐ waiting...
    error /data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2: Command failed.
    Exit code: 1
    Command: node-pre-gyp install --fallback-to-build
    Arguments:
    Directory: /data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2
    Output:
    node-pre-gyp info it worked if it ends with ok
    node-pre-gyp info using node-pre-gyp@1.0.6
    node-pre-gyp info using node@17.0.1 | android | arm64
    node-pre-gyp info check checked for "/data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3/argon2.node" (not found)
    node-pre-gyp http GET https://github.com/ranisalt/node-argon2/releases/download/v0.28.2/argon2-v0.28.2-napi-v3-android-arm64-unknown.tar.gz
    node-pre-gyp ERR! install response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.28.2/argon2-v0.28.2-napi-v3-android-arm64-unknown.tar.gz
    node-pre-gyp WARN Pre-built binaries not installable for argon2@0.28.2 and node@17.0.1 (node-v102 ABI, unknown) (falling back to source compile with node-gyp)
    node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/ranisalt/node-argon2/releases/download/v0.28.2/argon2-v0.28.2-napi-v3-android-arm64-unknown.tar.gz
    gyp info it worked if it ends with ok
    gyp info using node-gyp@8.2.0
    gyp info using node@17.0.1 | android | arm64
    gyp info ok
    gyp info it worked if it ends with ok
    gyp info using node-gyp@8.2.0
    gyp info using node@17.0.1 | android | arm64
    gyp info find Python using Python version 3.10.0 found at "/data/data/com.termux/files/usr/bin/python3"
    gyp http GET https://nodejs.org/download/release/v17.0.1/node-v17.0.1-headers.tar.gz
    gyp http 200 https://nodejs.org/download/release/v17.0.1/node-v17.0.1-headers.tar.gz
    gyp http GET https://nodejs.org/download/release/v17.0.1/SHASUMS256.txt
    gyp WARN install got an error, rolling back install
    gyp ERR! configure error
    gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v17.0.1/SHASUMS256.txt failed, reason: socket hang up
    gyp ERR! stack at ClientRequest. (/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:110:14)
    gyp ERR! stack at ClientRequest.emit (node:events:390:28)
    gyp ERR! stack at TLSSocket.socketOnEnd (node:_http_client:471:9)
    gyp ERR! stack at TLSSocket.emit (node:events:402:35)
    gyp ERR! stack at endReadableNT (node:internal/streams/readable:1340:12)
    gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:83:21)
    gyp ERR! System Linux 4.14.116
    gyp ERR! command "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3/argon2.node" "--module_name=argon2" "--module_path=/data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
    gyp ERR! cwd /data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2
    gyp ERR! node -v v17.0.1
    gyp ERR! node-gyp -v v8.2.0
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute '/data/data/com.termux/files/usr/bin/node /data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
    node-pre-gyp ERR! stack at ChildProcess. (/data/data/com.termux/files/home/.config/yarn/global/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
    node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28)
    node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1062:16)
    node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
    node-pre-gyp ERR! System Linux 4.14.116
    node-pre-gyp ERR! command "/data/data/com.termux/files/usr/bin/node" "/data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd /data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2
    node-pre-gyp ERR! node -v v17.0.1
    node-pre-gyp ERR! node-pre-gyp -v v1.0.6
    node-pre-gyp ERR! not ok
    Failed to execute '/data/data/com.termux/files/usr/bin/node /data/data/com.termux/files/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2/lib/binding/napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)

  2. jsjoeio commented on Oct 29, 2021

    @jsjoeio
    Contributor

    Node v14 is the newest version supported by code-server at this time.

    error /data/data/com.termux/files/home/.config/yarn/global/node_modules/argon2: Command failed.

    Argh, this seems to be blocking a lot of people. Can you check the node-argon2 docs here?

  3. Justxd22 commented on Oct 30, 2021

    @Justxd22
    Author

    Node v14 is the newest version supported by code-server at this time.

    Unfortunately v14 isn't available anymore according to node the new nodejs-lts v16 started 5 days ago, and I can't find the old package in archives, i think you will have to somehow support the new lts?

    Argh, this seems to be blocking a lot of people. Can you check the node-argon2 docs here?

    I had a backup of my previous install, i will stick with it for now with code-server v3.9.3, i will test again with steps from node-argon2 when I'm free, thanks guys for your efforts

  4. jsjoeio commented on Nov 1, 2021

    @jsjoeio
    Contributor

    Unfortunately v14 isn't available anymore according to node the new nodejs-lts v16 started 5 days ago, and I can't find the old package in archives, i think you will have to somehow support the new lts?

    Hmm... can you try using nvm to install v14?

    i will test again with steps from node-argon2 when I'm free

    Sounds good!

  5. anonimo82 commented on Nov 2, 2021

    @anonimo82

    Having the same issue here.
    Is it there any update?

  6. jsjoeio commented on Nov 2, 2021

    @jsjoeio
    Contributor

    @anonimo82 have you tried using v14?

  7. anonimo82 commented on Nov 2, 2021

    @anonimo82

    No, how can I?

  8. jsjoeio commented on Nov 2, 2021

    @jsjoeio
    Contributor

    @anonimo82 use nvm. Here is a video or you can read the docs here

  9. tmgast commented on Nov 3, 2021

    @tmgast

    Chiming in as I'm also attempting to do a new install with a similar environment.

    nvm doesn't work on Termux because Termux is now required to use a PREFIX env var to work with Android 11's new security policies. nvm does not allow this and the only suggestion I've seen is to clear the PREFIX, which is not possible without completely breaking Termux.

    I've also attempted to use n, which is a similar solution for running multiple instance of Node, however, n doesn't appear to install a version of Node compatible with the OS. It may still be a solution, though more testing is needed, but I currently believe Termux/Android users are stuck with only latest and -lts versions of Node.

  10. anonimo82 commented on Nov 3, 2021

    @anonimo82

    @jsjoeio consider I'm working with Termux, package nvm is not available there

  11. jsjoeio commented on Nov 3, 2021

    @jsjoeio
    Contributor

    @tmgast thanks for all the details! I wasn't aware of that. Shoot, well I'm at a stand still then. I'm not sure exactly what we can do here 🤔 I'm going to mark this as blocked until we can find a workaround.

    cc @code-asher in case you see any obvious solutions.

  12. added
    blockedThis issue cannot proceed due to external factors
    and removed
    waiting-for-infoWaiting for more information from submitter
    on Nov 3, 2021
  13. anonimo82 commented on Nov 3, 2021

    @anonimo82

    Workaround: use VHEditor https://github.com/vhqtvn/VHEditor-Android

    By the way, all we need to do is targeting the latest node.js version. I hope it's easy enough

    Edit: For the records, here is the issue
    https://pastebin.com/AYyUkABU

    Note I'm using nodejs-lts package from Termux repository

  14. code-asher commented on Nov 4, 2021

    @code-asher
    Member
  15. RoyGalaxy commented on Nov 5, 2021

    @RoyGalaxy

    I also tried nvm and the --ignore-engines flag while installing via yarn none of them worked kindly make code-server compatible with v16 of node 🙏

  16. anonimo82 commented on Nov 5, 2021

    @anonimo82

    @RoyGalaxy, @code-asher told VS-Code is not compatible with that Node.js version yet, so the least we can do is just wait. Or, if you use Termux, persuade theyr developers to downgrade Node package, or make them offer a build 14 as a separate package, which is what I'm trying to do here: termux/termux-packages#7930

  17. anonimo82 commented on Nov 5, 2021

    @anonimo82

    Look at the link, it now works!

  18. code-asher commented on Nov 5, 2021

    @code-asher
    Member
  19. anonimo82 commented on Nov 5, 2021

    @anonimo82

    In fact, I'm having troubles with extensions, beside this, it works

    Look at this: termux/termux-packages#7930 (comment)

  20. stale commented on May 4, 2022

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

  21. Justxd22 commented on May 5, 2022

    @Justxd22
    Author

    Btw, i digged in my old backups i found code-server with node 14 installed I'm using it and it's working fine, I want to pack a .deb of node 14 for sharing if any one wants it, also so I can install on other devices,

    anyone know if it's possible to pack a .deb package of node?

  22. jsjoeio commented on May 6, 2022

    @jsjoeio
    Contributor

    anyone know if it's possible to pack a .deb package of node?

    No idea! But I will close this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedThis issue cannot proceed due to external factors

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions