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

Can´t run tldr npm client #179

Closed
JPRuehmann opened this issue Nov 26, 2017 · 19 comments
Closed

Can´t run tldr npm client #179

JPRuehmann opened this issue Nov 26, 2017 · 19 comments

Comments

@JPRuehmann
Copy link

Expected behaviour

tldr should show some information about itself

Actual behaviour

It throws the following.

Log, debug output

tldr                                                                                            ──(So,Nov26)─┘
/usr/local/lib/node_modules/tldr/node_modules/natural/lib/natural/classifiers/classifier.js:32
    if (e.code !== 'MODULE_NOT_FOUND') throw e;
                                       ^

Error: Could not locate the bindings file. Tried:
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/build/WebWorkerThreads.node
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/build/Debug/WebWorkerThreads.node
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/build/Release/WebWorkerThreads.node
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/out/Debug/WebWorkerThreads.node
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/Debug/WebWorkerThreads.node
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/out/Release/WebWorkerThreads.node
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/Release/WebWorkerThreads.node
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/build/default/WebWorkerThreads.node
 → /usr/local/lib/node_modules/tldr/node_modules/webworker-threads/compiled/8.0.0/linux/ia32/WebWorkerThreads.node
    at bindings (/usr/local/lib/node_modules/tldr/node_modules/bindings/bindings.js:93:9)
    at Object.<anonymous> (/usr/local/lib/node_modules/tldr/node_modules/webworker-threads/index.js:1:105)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/tldr/node_modules/natural/lib/natural/classifiers/classifier.js:29:19)

Environment

Kubuntu 16.04 LTS (32Bit)
node -v 9.2.0

@agnivade
Copy link
Member

It seems your platform does not support webworker-threads. Can you try the solution here - NaturalNode/natural#368 (comment) ?

@aero31aero
Copy link
Contributor

Didn't anticipate this. Should we move from natural to some other library? The platform in question in Ubuntu 16.04 and latest node, not at all uncommon.

@agnivade
Copy link
Member

Its not Ubuntu. I have Ubuntu 16.04 and it works fine. Must be an issue with Kubuntu.

@JPRuehmann
Copy link
Author

Kubuntu is Ubuntu just with KDE.
Since TLDR is no X APP there should be nothing different.

@aero31aero
Copy link
Contributor

I tried to recreate this, and turns out that having a different version of node and node-gyp (npm has its own node-gyp) could be creating this issue. Can you please check for that once?

@JPRuehmann
Copy link
Author

Thanks,
by
sudo -H npm r -g tldr
sudo -H npm r -g webworker-threads
and
npm i -g node-gyp
npm i -g webworker-threads
npm i -g tldr
it now works.

@agnivade
Copy link
Member

Interesting. Then I believe the issue was with node-gyp somehow not being able to pull and compile webworker-threads properly. @JPRuehmann - how did you install node in the first place ?

@JPRuehmann
Copy link
Author

sudo apt install nodejs
then
sudo npm i -g n
sudo n stable

@agnivade
Copy link
Member

Ah I see. Its always better to download and extract the standard node package. Both the node and npm versions are packaged in it. https://nodejs.org/dist/v9.2.0/node-v9.2.0-linux-x86.tar.xz

@JPRuehmann
Copy link
Author

Than I should not use repositories to, I don´t think that is a good Idea.
You should try to never use Software that is not in the Repositories.
Since I often try Software and functions that are not/until now in the repos. I often run in such Problems. Especialy with such complex subsystems as Nodejs, Python or Ruby.

@roccomuso
Copy link

I'm having the same issue.. I'm on Ubuntu v16.04.
Btw is the natural module really necessary? native dependencies should be avoided if not strictly necessary.

@agnivade
Copy link
Member

Yes it's necessary. Try the method which has worked for @JPRuehmann or you can do a fresh reinstall using the .tar.xz package.

@jpribyl
Copy link

jpribyl commented Mar 28, 2018

Hey guys, I just had this same issue and solved it by reinstalling webworker-threads inside the tldr package. I'm on Elementary Loki (derivative from ubuntu 16.04)

cd /usr/lib/node_modules/tldr/node_modules/
npm install webworker-threads/

@agnivade
Copy link
Member

agnivade commented Mar 28, 2018

Yes, that was the original solution in the first place.

@gpenghe
Copy link

gpenghe commented Jun 26, 2018

Hello, I am on Ubuntu and had the same issue. It didn't work after trying everything above, including suggestions elsewhere to use a new global directory ~/.npm-global. Then I just did a sudo rm -rf /usr/lib/node_modules/ and bam it works now. So it looks like tldr is still trying to search system node-modules first even after configuring it to use a different one with npm config set prefix '~/.npm-global'

@idleberg
Copy link

idleberg commented Jul 24, 2018

Same problem here on macOS. The workaround by @jpribyl works for me, but a long-term solution would be preferred.

macOS 10.13.6
Node 10.5.0
npm 6.1.0

@agnivade
Copy link
Member

I have just pushed a commit which removes the dependency on webworkers. Will push a new release in some time.

@otterzy
Copy link

otterzy commented Oct 20, 2023

Can someone help me check my local error log? Thanks in advance.
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using npm@9.8.1
2 info using node@v18.18.2
3 timing npm:load:whichnode Completed in 3ms
4 timing config:load:defaults Completed in 4ms
5 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 2ms
6 timing config:load:builtin Completed in 2ms
7 timing config:load:cli Completed in 2ms
8 timing config:load:env Completed in 0ms
9 timing config:load:project Completed in 2ms
10 timing config:load:file:C:\Users\zhankram.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:C:\Users\zhankram\AppData\Roaming\npm\etc\npmrc Completed in 0ms
13 timing config:load:global Completed in 1ms
14 timing config:load:setEnvs Completed in 1ms
15 timing config:load Completed in 12ms
16 timing npm:load:configload Completed in 12ms
17 timing config:load:flatten Completed in 2ms
18 timing npm:load:mkdirpcache Completed in 0ms
19 timing npm:load:mkdirplogs Completed in 1ms
20 verbose title npm install tldr
21 verbose argv "install" "--global" "tldr"
22 timing npm:load:setTitle Completed in 1ms
23 timing npm:load:display Completed in 0ms
24 verbose logfile logs-max:10 dir:C:\Users\zhankram\AppData\Local\npm-cache_logs\2023-10-20T07_02_10_064Z-
25 verbose logfile C:\Users\zhankram\AppData\Local\npm-cache_logs\2023-10-20T07_02_10_064Z-debug-0.log
26 timing npm:load:logFile Completed in 15ms
27 timing npm:load:timers Completed in 0ms
28 timing npm:load:configScope Completed in 0ms
29 timing npm:load Completed in 57ms
30 timing config:load:flatten Completed in 0ms
31 timing arborist:ctor Completed in 0ms
32 timing idealTree:init Completed in 31ms
33 timing idealTree:userRequests Completed in 1ms
34 silly idealTree buildDeps
35 silly fetch manifest tldr@*
36 silly logfile done cleaning log files
37 silly placeDep ROOT tldr@ OK for: want: *
38 timing idealTree:#root Completed in 71163ms
39 timing idealTree:node_modules/tldr Completed in 0ms
40 timing idealTree:buildDeps Completed in 71164ms
41 timing idealTree:fixDepFlags Completed in 0ms
42 timing idealTree Completed in 71197ms
43 timing command:install Completed in 71208ms
44 verbose type system
45 verbose stack FetchError: request to https://registry.npmjs.org/tldr failed, reason: unable to verify the first certificate
45 verbose stack at ClientRequest. (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
45 verbose stack at ClientRequest.emit (node:events:517:28)
45 verbose stack at TLSSocket.socketErrorListener (node:_http_client:501:9)
45 verbose stack at TLSSocket.emit (node:events:529:35)
45 verbose stack at emitErrorNT (node:internal/streams/destroy:151:8)
45 verbose stack at emitErrorCloseNT (node:internal/streams/destroy:116:3)
45 verbose stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
46 verbose cwd C:\Users\zhankram
47 verbose Windows_NT 10.0.19045
48 verbose node v18.18.2
49 verbose npm v9.8.1
50 error code UNABLE_TO_VERIFY_LEAF_SIGNATURE
51 error errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
52 error request to https://registry.npmjs.org/tldr failed, reason: unable to verify the first certificate
53 verbose exit 1
54 timing npm Completed in 71494ms
55 verbose unfinished npm timer reify 1697785330348
56 verbose unfinished npm timer reify:loadTrees 1697785330357
57 verbose code 1
58 error A complete log of this run can be found in: C:\Users\zhankram\AppData\Local\npm-cache_logs\2023-10-20T07_02_10_064Z-debug-0.log

@kbdharun
Copy link
Member

Hello @otterzy,

From the log you provided.

  • It is possible that the npm version you are using is outdated, you can try updating it to the latest version.
  • It might be an SSL issue if the above step doesn't work try to set another registry.
  • If you still face issues, I would suggest checking if your firewall blocks requests to NPM.

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

No branches or pull requests

9 participants