steelbrain / steelbrain/node-ssh

Module @types/ssh2 has no default export

Open
#389 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1k
Forks
94
PR merge metrics
No merged PRs in 30d

Description

I'm using node-ssh with Typescript and the compilation fails with the following error:

node_modules/node-ssh/lib/typings/index.d.ts:2:8 - error TS1192: Module '"/var/www/tedev1/node_modules/@types/ssh2/index"' has no default export.

2 import SSH2, { ConnectConfig, ClientChannel, SFTPWrapper, ExecOptions, PseudoTtyOptions, ShellOptions } from 'ssh2';

Before doing npm i --save-dev @types/ssh2 I had the same compilation error as #380.

Here is my tsconfig:

{
  "compilerOptions": {
      "module": "CommonJS",
      "resolveJsonModule": true,
      "target": "ES2019",
      "moduleResolution": "node",
      "noImplicitAny": true,
  
      "removeComments": true,
      "composite": true,
      "noEmitOnError": true,
      ...
  }
}

Could it be because of "moduleResolution": "node"?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with lib/typings/index.d.ts and the installed @types/ssh2 declarations, then reproduce the reported TS1192 error using the supplied tsconfig settings. Done means node-ssh's TypeScript declarations compile successfully for the reported CommonJS and Node module-resolution setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.