microsoft / node-pty

Fork pseudoterminals in Node.JS
Other
1.46k stars 235 forks source link

Cannot install the package using either `yarn` or `npm` #511

Closed rgeorgiev583 closed 2 years ago

rgeorgiev583 commented 2 years ago

Environment details

Issue description

When I run yarn global add node-pty, the command freezes with the following output:

yarn global v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "@types/download@6.2.4".
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "body-parser@1.19.0".
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "download@8.0.0".
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "express@4.17.1".
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "safe-compare@1.1.4".
[4/4] Building fresh packages...
[1/5] ⠂ core-js
[2/5] ⠂ dtrace-provider
[-/5] ⠄ waiting...
[-/5] ⡀ waiting...
[2/5] ⡀ dtrace-provider
[-/5] ⡀ waiting...
[-/5] ⡀ waiting...
error /home/sid/.config/yarn/global/node_modules/node-pty: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments: 
Directory: /home/sid/.config/yarn/global/node_modules/node-pty
Output:
node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: spawn node-gyp ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn node-gyp',

[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "@types/download@6.2.4".
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "body-parser@1.19.0".
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "download@8.0.0".
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "express@4.17.1".
warning "web-ext > addons-linter > addons-scanner-utils@4.0.0" has unmet peer dependency "safe-compare@1.1.4".
[4/4] Building fresh packages...
[-/4] ⠐ waiting...
[2/4] ⠐ dtrace-provider
[-/4] ⠐ waiting...

When I try to install it with npm using the sudo npm install -g node-pty command, it fails with the following output:

> node-pty@0.10.1 install /usr/lib/node_modules/node-pty
> node scripts/install.js

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/root/.cache/node-gyp/16.11.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/node-pty/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/node-pty/.node-gyp'
gyp ERR! System Linux 5.10.76-1-lts
gyp ERR! command "/usr/bin/node" "/home/sid/.config/yarn/global/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/node-pty
gyp ERR! node -v v16.11.1
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-pty@0.10.1 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-pty@0.10.1 install 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!     /root/.npm/_logs/2021-11-16T15_34_17_497Z-debug.log
Tyriar commented 2 years ago

duplicate of https://github.com/microsoft/node-pty/issues/438