@types/ssh2 are required when using TS `strictMode`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- node.js, typescript
- Domain
- backend
Research direction
Start by checking how node-ssh declares dependencies and inspect the imports in node_modules/node-ssh/lib/typings/index.d.ts. Reproduce the reported TypeScript strictMode compilation failure, then verify that a consumer no longer needs to install the ssh2 type packages separately.
Written by the indexing model from the issue text.
Description
When using Typescript's strictMode, the compilation fails with the following error:
node_modules/node-ssh/lib/typings/index.d.ts:2:110 - error TS7016: Could not find a declaration file for module 'ssh2'. './node_modules/ssh2/lib/client.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/ssh2` if it exists or add a new declaration (.d.ts) file containing `declare module 'ssh2';`
2 import SSH2, { ConnectConfig, ClientChannel, SFTPWrapper, ExecOptions, PseudoTtyOptions, ShellOptions } from 'ssh2';
~~~~~~
node_modules/node-ssh/lib/typings/index.d.ts:3:41 - error TS7016: Could not find a declaration file for module 'ssh2-streams'. './node_modules/ssh2-streams/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/ssh2-streams` if it exists or add a new declaration (.d.ts) file containing `declare module 'ssh2-streams';`
3 import { Prompt, TransferOptions } from 'ssh2-streams';
~~~~~~~~~~~~~~
Found 2 errors.
The fix is quite easy, simply install @types/ssh2 (which also installs @types/ssh2-streams, see here:
npm i --save-dev @types/ssh2
I think that installing the types dependencies is not the responsibility of the end user. Shouldn't the @types/ssh2 be installed as part of node-ssh dependencies or peerDependencies?
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from steelbrain/node-ssh
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
steelbrain/node-ssh#487 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
steelbrain/node-ssh#482 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
steelbrain/node-ssh#474 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
steelbrain/node-ssh#473 · 1 comment · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
steelbrain/node-ssh#472 ·
All issues in steelbrain/node-ssh
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 62/100
lingdojo/kana-dojo#34127 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
osmlab/name-suggestion-index#13104 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100