You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling with typescript 4.8.3 (at this time latest version), I am getting this error:
node_modules/node-ssh/lib/typings/index.d.ts:2:8 - error TS1259: Module '"stream"' can only be default-imported using the 'esModuleInterop' flag
2 import stream from 'stream';
~~~~~~
node_modules/@types/node/stream.d.ts:333:5
333 export = internal;
~~~~~~~~~~~~~~~~~~
This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.
When setting esModuleInterop to true, typescript renders other used libraries properties with getters only e.g.:
prompt.message = '';
^
TypeError: Cannot set property message of # which has only a getter
at Object. (/home/cj/auto-config/auto-config-init.js:161:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Workaround: Editing file node_modules/node-ssh/lib/typings/index.d.ts so the line at the begining: import stream from 'stream';to be: import * as stream from 'stream';
solves issue for me without esModuleInterop flag set.
Can you please add this change in the next version?
Thank you in advance CJ
The text was updated successfully, but these errors were encountered:
When compiling with typescript 4.8.3 (at this time latest version), I am getting this error:
When setting esModuleInterop to true, typescript renders other used libraries properties with getters only e.g.:
The text was updated successfully, but these errors were encountered: