llnode icon indicating copy to clipboard operation
llnode copied to clipboard

llnode failed to install

Open PugDeveloper opened this issue 4 years ago • 10 comments

Hi, I'm getting this error below, Any help appreciated:

`matchapug@MRPUG:/mnt/c/Windows/system32$ npm install -g llnode

> [email protected] preinstall /home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode
> node scripts/configure.js

Build dir is: /home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode
Looking for lldb executable...
Found lldb executable /usr/bin/lldb

Reading lldb version...
Installing llnode for /usr/bin/lldb, lldb version 10.0

Looking for llvm-config for lldb 10.0...
Using llvm-config in /usr/bin/llvm-config

Looking for headers for lldb 10.0...
Could not find the headers, will download them later

Looking for shared libraries for lldb 10.0...
From ldd: /usr/bin/lldb loads /lib/x86_64-linux-gnu/liblldb-10.so.1
Found liblldb-10.so in /lib/x86_64-linux-gnu

Cloning lldb release_100 into /home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode/lldb-10.0
Cloning into '/home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode/lldb-10.0'...
warning: Could not find remote branch release_100 to clone.
fatal: Remote branch release_100 not found in upstream origin
child_process.js:830
    throw err;
    ^

Error: Command failed: git clone --depth 1 --branch release_100 https://github.com/llvm-mirror/lldb.git /home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode/lldb-10.0
    at checkExecSyncError (child_process.js:790:11)
    at Object.execFileSync (child_process.js:827:15)
    at Object.cloneHeaders (/home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode/scripts/lldb.js:47:19)
    at configureInstallation (/home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode/scripts/configure.js:89:25)
    at main (/home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode/scripts/configure.js:12:34)
    at Object.<anonymous> (/home/matchapug/.nvm/versions/node/v14.18.1/lib/node_modules/llnode/scripts/configure.js:20:1)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
  status: 128,
  signal: null,
  output: [ null, null, null ],
  pid: 304,
  stdout: null,
  stderr: null
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: `node scripts/configure.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/matchapug/.npm/_logs/2021-11-09T03_01_36_875Z-debug.log`

PugDeveloper avatar Nov 09 '21 03:11 PugDeveloper

Same as https://github.com/nodejs/llnode/issues/350 As far as I can tell the fix is available here https://github.com/nodejs/llnode/pull/389 It's just waiting for CI to be sorted.

No9 avatar Nov 09 '21 09:11 No9

Ah I see, Thank you. Not sure if I'm manually installing this correct. Do I just follow the below step?: Cause I did the below and its not working (minus the && sign)

` # globally install llnode
 && git clone --branch use-llvm-project-monorepo https://github.com/trxcllnt/llnode.git /usr/local/lib/llnode \
 && npm install --global --unsafe-perm --no-audit --no-fund /usr/local/lib/llnode \
 && which -a llnode`

PugDeveloper avatar Nov 11 '21 00:11 PugDeveloper

Yes that's the command it's hard to see what's going on without the error message but note it runs in system folders so it should be ran as root

No9 avatar Nov 11 '21 07:11 No9

When I run the npm now I get this error:

matchapug@MRPUG:~$ npm install --global --unsafe-perm --no-audit --no-fund /usr/local/lib/llnode
npm ERR! code 1
npm ERR! path /usr/local/lib/llnode
npm ERR! command failed
npm ERR! command sh -c node scripts/configure.js
npm ERR! Build dir is: /usr/local/lib/llnode
npm ERR! Looking for lldb executable...
npm ERR! Found lldb executable /usr/bin/lldb
npm ERR!
npm ERR! Reading lldb version...
npm ERR! Installing llnode for /usr/bin/lldb, lldb version 10.0
npm ERR!
npm ERR! Looking for llvm-config for lldb 10.0...
npm ERR! Using llvm-config in /usr/bin/llvm-config
npm ERR!
npm ERR! Looking for headers for lldb 10.0...
npm ERR! Could not find the headers, will download them later
npm ERR!
npm ERR! Looking for shared libraries for lldb 10.0...
npm ERR! From ldd: /usr/bin/lldb loads /lib/x86_64-linux-gnu/liblldb-10.so.1
npm ERR! Found liblldb-10.so in /lib/x86_64-linux-gnu
npm ERR!
npm ERR! Cloning lldb release/10.x into /usr/local/lib/llnode/lldb-10.0
npm ERR! Cloning into '/usr/local/lib/llnode/lldb-10.0'...
npm ERR! fatal: cannot change to 'https://github.com/llvm/llvm-project.git': No such file or directory
npm ERR! error: failed to initialize sparse-checkout
npm ERR! node:child_process:867
npm ERR!     throw err;
npm ERR!     ^
npm ERR!
npm ERR! Error: Command failed: git clone --depth 1 --filter=blob:none --sparse --branch release/10.x https://github.com/llvm/llvm-project.git /usr/local/lib/llnode/lldb-10.0
npm ERR!     at checkExecSyncError (node:child_process:826:11)
npm ERR!     at Object.execFileSync (node:child_process:864:15)
npm ERR!     at Object.cloneHeaders (/usr/local/lib/llnode/scripts/lldb.js:66:19)
npm ERR!     at configureInstallation (/usr/local/lib/llnode/scripts/configure.js:89:25)
npm ERR!     at main (/usr/local/lib/llnode/scripts/configure.js:12:34)
npm ERR!     at Object.<anonymous> (/usr/local/lib/llnode/scripts/configure.js:20:1)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
npm ERR!   status: 1,
npm ERR!   signal: null,
npm ERR!   output: [ null, null, null ],
npm ERR!   pid: 8024,
npm ERR!   stdout: null,
npm ERR!   stderr: null
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/matchapug/.npm/_logs/2021-11-12T01_45_59_729Z-debug.log

PugDeveloper avatar Nov 12 '21 01:11 PugDeveloper

This line looks very suspicious npm ERR! fatal: cannot change to 'https://github.com/llvm/llvm-project.git': No such file or directory Can you confirm that /usr/local/lib/llnode/lldb-10.0 has been generated and the code is checked out into it. The output of the command ls -R /usr/local/lib/llnode/lldb-10.0 will confirm it

No9 avatar Nov 14 '21 08:11 No9

I see it seem like there isn't a 11db-10.0 folder within the llnode. Would you happen to know why? Kind of new to this so bit confusing.

Thanks for the help so far!

PugDeveloper avatar Nov 16 '21 03:11 PugDeveloper

It's likely not working due to permissions but I can't say for sure. You might be able to work around this by checking it out and build it from your home directory Just ran this on my local machine as a single command and it worked fine.

cd ~ && git clone --branch use-llvm-project-monorepo https://github.com/trxcllnt/llnode.git && cd llnode && npm install --global --unsafe-perm --no-audit --no-fund 

Heres a breakdown of what's going on.

  1. It sets the current directory to be your home cd ~
  2. Does a checkout of trxcllnt's PR branch into that folder git clone --branch use-llvm-project-monorepo https://github.com/trxcllnt/llnode.git
  3. moves into the checkout folder cd llnode
  4. Runs the build npm install --global --unsafe-perm --no-audit --no-fund If that doesn't work it may be better waiting for the PR to land

No9 avatar Nov 16 '21 12:11 No9

Ah I see, still doesn't work, Seem like would nee to wait for PR. Anyone knows when that will happen?

PugDeveloper avatar Nov 19 '21 02:11 PugDeveloper

When I run the npm now I get this error:

matchapug@MRPUG:~$ npm install --global --unsafe-perm --no-audit --no-fund /usr/local/lib/llnode
npm ERR! code 1
npm ERR! path /usr/local/lib/llnode
npm ERR! command failed
npm ERR! command sh -c node scripts/configure.js
npm ERR! Build dir is: /usr/local/lib/llnode
npm ERR! Looking for lldb executable...
npm ERR! Found lldb executable /usr/bin/lldb
npm ERR!
npm ERR! Reading lldb version...
npm ERR! Installing llnode for /usr/bin/lldb, lldb version 10.0
npm ERR!
npm ERR! Looking for llvm-config for lldb 10.0...
npm ERR! Using llvm-config in /usr/bin/llvm-config
npm ERR!
npm ERR! Looking for headers for lldb 10.0...
npm ERR! Could not find the headers, will download them later
npm ERR!
npm ERR! Looking for shared libraries for lldb 10.0...
npm ERR! From ldd: /usr/bin/lldb loads /lib/x86_64-linux-gnu/liblldb-10.so.1
npm ERR! Found liblldb-10.so in /lib/x86_64-linux-gnu
npm ERR!
npm ERR! Cloning lldb release/10.x into /usr/local/lib/llnode/lldb-10.0
npm ERR! Cloning into '/usr/local/lib/llnode/lldb-10.0'...
npm ERR! fatal: cannot change to 'https://github.com/llvm/llvm-project.git': No such file or directory
npm ERR! error: failed to initialize sparse-checkout
npm ERR! node:child_process:867
npm ERR!     throw err;
npm ERR!     ^
npm ERR!
npm ERR! Error: Command failed: git clone --depth 1 --filter=blob:none --sparse --branch release/10.x https://github.com/llvm/llvm-project.git /usr/local/lib/llnode/lldb-10.0
npm ERR!     at checkExecSyncError (node:child_process:826:11)
npm ERR!     at Object.execFileSync (node:child_process:864:15)
npm ERR!     at Object.cloneHeaders (/usr/local/lib/llnode/scripts/lldb.js:66:19)
npm ERR!     at configureInstallation (/usr/local/lib/llnode/scripts/configure.js:89:25)
npm ERR!     at main (/usr/local/lib/llnode/scripts/configure.js:12:34)
npm ERR!     at Object.<anonymous> (/usr/local/lib/llnode/scripts/configure.js:20:1)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
npm ERR!   status: 1,
npm ERR!   signal: null,
npm ERR!   output: [ null, null, null ],
npm ERR!   pid: 8024,
npm ERR!   stdout: null,
npm ERR!   stderr: null
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/matchapug/.npm/_logs/2021-11-12T01_45_59_729Z-debug.log

Installing the liblldb-dev package on ubuntu fixed this for me. This package contains the needed lldb header. No need for the git clone during the installation anymore ... Would the llnode not be simpler by just specifying this package as a needed prerequisite?

Beretta1979 avatar Jan 11 '22 13:01 Beretta1979

Installing the liblldb-dev package on ubuntu fixed this for me. This package contains the needed lldb header. No need for the git clone during the installation anymore ... Would the llnode not be simpler by just specifying this package as a needed prerequisite?

This did it for me, thanks

jaenster avatar Jun 09 '22 09:06 jaenster

OK we now have support for LLDB 8 to 14 and Node 14,16,18 so I'm closing this. We are still getting the headers from github so please follow/comment on https://github.com/nodejs/llnode/issues/382 if that is an issue.

No9 avatar Sep 17 '22 15:09 No9

Commenting this in case anybody ran into this issue like I did currently, but if you're seeing the sparse-checkout error then it may be due to your version of git. Check to make sure your git --version is 2.26 or higher.

If you're on Ubuntu like I am, you'll need to add the PPA for newer versions of git

Once I updated my git, this issue dissappeared :smiley:

antontsvil avatar Oct 21 '23 09:10 antontsvil