Skip to content

curl: (3) malformed when nvm install #1562

Closed

Description

@21paradox
  • Operating system and version:

  • nvm debug output:

Details
nvm --version: v0.33.2
$SHELL: /bin/bash
$HOME: /home/xxxx
$NVM_DIR: '$HOME/nvm'
$PREFIX: ''
$NPM_CONFIG_PREFIX: ''
$NVM_NODEJS_ORG_MIRROR: 'http://nodejs.mirrors.mx.sanxxxxx.com/dist'
$NVM_IOJS_ORG_MIRROR: ''
shell version: 'GNU bash, version 4.1.2(1)-releases (x86_64-redhat-linux-gnu)'
uname -a: 'Linux 2.6.32-431.20.3.el6.mt20161028.x86_64 #1 SMP Fri Oct 28 17:50:35 CST 2016 x86_64 x86_64 x86_64 GNU/Linux'
OS version: CentOS release 6.5 (Final)
curl: /usr/bin/curl, curl 7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.15.3 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
wget: /usr/bin/wget, GNU Wget 1.12 built on linux-gnu.
git: /usr/bin/git, git version 1.7.1
nvm current: v6.11.0
which node: $NVM_DIR/versions/node/v6.11.0/bin/node
which iojs: which: no iojs in ($NVM_DIR/versions/node/v6.11.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/java/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:$HOME/bin)
which npm: $NVM_DIR/versions/node/v6.11.0/bin/npm
npm config get prefix: $NVM_DIR/versions/node/v6.11.0
npm root -g: $NVM_DIR/versions/node/v6.11.0/lib/node_modules
  • nvm ls output:
Details

curl: (3) malformed when nvm install,

curl version is 7.19.7

  • If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?
Details
Downloading and installing node v4.8.3...
Downloading http://nodejs.mirrors.mx.sankuai.com/dist/v4.8.3/node-v4.8.3-linux-x64.tar.xz...
curl: (3) <url> malformed
######################################################################## 100.0%
grep: /home/xxxxx/nvm/.cache/bin/node-v4.8.3-linux-x64/node-v4.8.3-linux-x64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Downloading http://nodejs.mirrors.mx.sanxxxx.com/dist/v4.8.3/node-v4.8.3.tar.xz...
curl: (3) <url> malformed
######################################################################## 100.0%
grep: /home/shiwenzhe/nvm/.cache/src/node-v4.8.3/node-v4.8.3.tar.xz: No such file or directory
Provided file to checksum does not exist.

Activity

  1. 21paradox commented on Jun 22, 2017

    @21paradox
    Author

    this only happens in the master branch.

  2. ljharb commented on Jun 22, 2017

    @ljharb
    Member

    What does nvm_curl_libz_support ; echo $? print out?

  3. 21paradox commented on Jun 22, 2017

    @21paradox
    Author

    @ljharb empty

  4. ljharb commented on Jun 22, 2017

    @ljharb
    Member

    the echo $? doesn't print a 0 or a 1?

  5. 21paradox commented on Jun 22, 2017

    @21paradox
    Author

    @ljharb sorry,i haven't check.after append below to nvm.sh

    echo "start"
    nvm_curl_libz_support ; echo $x?
    

    source nvm.sh

    returns

    start
    0
    
  6. ljharb commented on Jun 22, 2017

    @ljharb
    Member

    not $x? - just $?. An alternative is if nvm_curl_libz_support; then echo yes; else echo no; fi

  7. 21paradox commented on Jun 23, 2017

    @21paradox
    Author

    @ljharb echo yes

  8. ljharb commented on Jun 23, 2017

    @ljharb
    Member

    ah - i just realized you have a mirror set up. Does it work if you unset NVM_NODEJS_ORG_MIRROR before trying?

    If so, then the problem is the mirror itself.

  9. 21paradox commented on Jun 23, 2017

    @21paradox
    Author
    nvm install v4
    Downloading and installing node v4.8.3...
    Downloading https://nodejs.org/dist/v4.8.3/node-v4.8.3-linux-x64.tar.xz...
    curl: (3) <url> malformed
    ######################################################################## 100.0%
    grep: /home/shiwenzhe/nvm/.cache/bin/node-v4.8.3-linux-x64/node-v4.8.3-linux-x64.tar.xz: No such file or directory
    Provided file to checksum does not exist.
    Binary download failed, trying source.
    Detected that you have 2 CPU core(s)
    Number of CPU core(s) less than or equal to 2, running in single-threaded mode
    Downloading https://nodejs.org/dist/v4.8.3/node-v4.8.3.tar.xz...
    curl: (3) <url> malformed
    ##################                                                        25.2%
    
    

    still have the same error. v0.33.1 and before works fine

  10. ljharb commented on Jun 24, 2017

    @ljharb
    Member

    Thanks. Can you also try adding either nvm_echo or nvm_err in front of the command here and tell me what command it prints out?

  11. 21paradox commented on Jun 26, 2017

    @21paradox
    Author

    @ljharb I try v0.33.2 works fine now. i think it only happens in master branch.
    i put nvm_echo curl --fail "${CURL_COMPRESSED_FLAG:-}" -q "$@"
    nvm_err curl --fail "${CURL_COMPRESSED_FLAG:-}" -q "$@"

    before https://github.com/creationix/nvm/blob/master/nvm.sh#L113
    shows:

    nvm install v4
    curl --fail  -q -L -s http://nodejs.mirrors.mx.sankuai.com/dist/index.tab -o -
    curl --fail  -q -L -s https://iojs.org/dist/index.tab -o -
    Downloading and installing node v4.8.3...
    curl --fail  -q -L -s http://nodejs.mirrors.mx.sankuai.com/dist/v4.8.3/SHASUMS256.txt -o -
    Downloading http://nodejs.mirrors.mx.sankuai.com/dist/v4.8.3/node-v4.8.3-linux-x64.tar.xz...
    curl --fail  -q -L -C - --progress-bar http://nodejs.mirrors.mx.sankuai.com/dist/v4.8.3/node-v4.8.3-linux-x64.tar.xz -o /home/xxxxx/test/nvm/.cache/bin/node-v4.8.3-linux-x64/node-v4.8.3-linux-x64.tar.xz
    curl: (3) <url> malformed
    ######################################################################## 100.0%
    grep: /home/xxxxx/test/nvm/.cache/bin/node-v4.8.3-linux-x64/node-v4.8.3-linux-x64.tar.xz: No such file or directory
    Provided file to checksum does not exist.
    Binary download failed, trying source.
    Detected that you have 2 CPU core(s)
    Number of CPU core(s) less than or equal to 2, running in single-threaded mode
    curl --fail  -q -L -s http://nodejs.mirrors.mx.sankuai.com/dist/v4.8.3/SHASUMS256.txt -o -
    Downloading http://nodejs.mirrors.mx.sankuai.com/dist/v4.8.3/node-v4.8.3.tar.xz...
    curl --fail  -q -L -C - --progress-bar http://nodejs.mirrors.mx.sankuai.com/dist/v4.8.3/node-v4.8.3.tar.xz -o /home/xxxxx/test/nvm/.cache/src/node-v4.8.3/node-v4.8.3.tar.xz
    curl: (3) <url> malformed
    ######################################################################## 100.0%
    grep: /home/xxxxxx/test/nvm/.cache/src/node-v4.8.3/node-v4.8.3.tar.xz: No such file or directory
    Provided file to checksum does not exist.
    
  12. ljharb commented on Jun 26, 2017

    @ljharb
    Member

    #1557 added the --fail param. @PeterDaveHello, can you shed some light?

  13. PeterDaveHello commented on Jun 27, 2017

    @PeterDaveHello
    Collaborator

    I can confirmed that problem and 7965796 is the first bad commit in this situation. This is not --fail related.

    The root cause should be my commit to enabled --compressed, the usage of "${CURL_COMPRESSED_FLAG:-}", but triggered by the commit to make sure curl version >= 7.21.0, as when curl doesn't meet the version requirement, the compressed flag will turn to '' which is not a valid for curl.

    I'll send a PR to fix it.

  14. ljharb commented on Jun 27, 2017

    @ljharb
    Member

    Thank you!

  15. added a commit that references this issue on Apr 9, 2018
    1346b2e
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions