Closed elliotwesoff closed 7 years ago
Hey @elliotwesoff,
I made the conscious decision to not package type dependencies with BrowserFS. BrowserFS assumes that you have the types installed locally to your project. Perhaps I should amend this policy, now that types are in NPM. (Previously, if you depended on Node typings and if BrowserFS bundled them, your project would have two conflicting typings for Node.)
You'll need to install the @types/dropboxjs
, @types/node
, and @types/filesystem
packages, if I remember correctly.
The complaint about ErrnoException
should go away if you upgrade your Node type definitions. Let me know if this isn't the case, or if this fix needs to be backported to other Node typings.
Hey @jvilk,
Sorry, I'm pretty new to Angular/Typescript/NodeJS in general, but do I need to add those to my typings.json? I just installed them with npm install @types/dropboxjs @types/node @types/filesystem --save-dev
and I'm now getting an even longer list of errors. Help?
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(102,6): error TS2300: Duplicate identifier 'BufferEncoding'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(263,18): error TS2300: Duplicate identifier 'EventEmitter'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(306,22): error TS2430: Interface 'ReadWriteStream' incorrectly extends interface 'ReadableStream'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(306,22): error TS2430: Interface 'ReadWriteStream' incorrectly extends interface 'ReadableStream'.
Types of property 'pause' are incompatible.
Type '() => ReadWriteStream' is not assignable to type '{ (): this; (): ReadableStream; }'.
Type 'ReadWriteStream' is not assignable to type 'this'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(564,9): error TS2502: 'BuffType' is referenced directly or indirectly in its own type annotation.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(565,9): error TS2502: 'SlowBuffType' is referenced directly or indirectly in its own type annotation.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(566,26): error TS2300: Duplicate identifier 'Buffer'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(566,50): error TS2300: Duplicate identifier 'SlowBuffer'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(610,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(634,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'Server' and 'EventEmitter'.
Named property 'addListener' of types 'Server' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(634,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'Server' and 'EventEmitter'.
Named property 'emit' of types 'Server' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(634,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'Server' and 'EventEmitter'.
Named property 'on' of types 'Server' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(634,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'Server' and 'EventEmitter'.
Named property 'once' of types 'Server' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(634,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'Server' and 'EventEmitter'.
Named property 'prependListener' of types 'Server' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(634,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'Server' and 'EventEmitter'.
Named property 'prependOnceListener' of types 'Server' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(646,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'addListener' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(646,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'emit' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(646,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'on' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(646,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'once' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(646,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'prependListener' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(646,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'prependOnceListener' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(646,22): error TS2320: Interface 'ServerResponse' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'removeListener' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(676,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'addListener' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(676,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'emit' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(676,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'on' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(676,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'once' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(676,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'prependListener' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(676,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'prependOnceListener' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(676,22): error TS2320: Interface 'ClientRequest' cannot simultaneously extend types 'Writable' and 'EventEmitter'.
Named property 'removeListener' of types 'Writable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(702,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'Readable' and 'EventEmitter'.
Named property 'addListener' of types 'Readable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(702,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'Readable' and 'EventEmitter'.
Named property 'emit' of types 'Readable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(702,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'Readable' and 'EventEmitter'.
Named property 'on' of types 'Readable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(702,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'Readable' and 'EventEmitter'.
Named property 'once' of types 'Readable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(702,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'Readable' and 'EventEmitter'.
Named property 'prependListener' of types 'Readable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(702,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'Readable' and 'EventEmitter'.
Named property 'prependOnceListener' of types 'Readable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(702,22): error TS2320: Interface 'IncomingMessage' cannot simultaneously extend types 'Readable' and 'EventEmitter'.
Named property 'removeListener' of types 'Readable' and 'EventEmitter' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(756,18): error TS2300: Duplicate identifier 'Agent'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(814,18): error TS2300: Duplicate identifier 'Worker'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(1543,17): error TS2300: Duplicate identifier 'CompleterResult'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(1580,18): error TS2300: Duplicate identifier 'Script'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(2016,22): error TS2320: Interface 'Server' cannot simultaneously extend types 'EventEmitter' and 'Socket'.
Named property 'removeListener' of types 'EventEmitter' and 'Socket' are not identical.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(2528,22): error TS2451: Cannot redeclare block-scoped variable 'constants'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(2876,18): error TS2300: Duplicate identifier 'TLSSocket'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(3250,10): error TS2300: Duplicate identifier 'Utf8AsciiLatin1Encoding'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(3251,10): error TS2300: Duplicate identifier 'HexBase64Latin1Encoding'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(3252,10): error TS2300: Duplicate identifier 'Utf8AsciiBinaryEncoding'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(3253,10): error TS2300: Duplicate identifier 'HexBase64BinaryEncoding'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(3254,10): error TS2300: Duplicate identifier 'ECDHKeyFormat'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(3607,5): error TS2300: Duplicate identifier 'export='.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(3690,5): error TS2300: Duplicate identifier 'export='.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(3712,18): error TS2300: Duplicate identifier 'Domain'.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(4004,5): error TS2300: Duplicate identifier 'export='.
ERROR in C:\Users\Admin\ng2-project\node_modules\@types\node\index.d.ts
(4046,5): error TS2300: Duplicate identifier 'export='.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(46,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'main' must be of type 'NodeModule', but here has type 'any'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(57,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'parent' must be of type 'NodeModule', but here has type 'any'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(58,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'children' must be of type 'NodeModule[]', but here has type 'any[]'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(78,6): error TS2300: Duplicate identifier 'BufferEncoding'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(227,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'errno' must be of type 'number', but here has type 'string'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(234,18): error TS2300: Duplicate identifier 'EventEmitter'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(364,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'platform' must be of type 'Platform', but here has type 'string'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(520,26): error TS2300: Duplicate identifier 'Buffer'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(520,50): error TS2300: Duplicate identifier 'SlowBuffer'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(651,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'httpVersionMajor' must be of type 'number', but here has type 'string'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(652,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'httpVersionMinor' must be of type 'number', but here has type 'string'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(653,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'connection' must be of type 'Socket', but here has type 'any'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(703,18): error TS2300: Duplicate identifier 'Agent'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(745,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'addressType' must be of type 'number | "udp4" | "udp6"', but here has type 'string'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(748,18): error TS2300: Duplicate identifier 'Worker'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(1141,22): error TS2300: Duplicate identifier 'CompleterResult'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(1181,18): error TS2300: Duplicate identifier 'Script'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(1848,18): error TS2451: Cannot redeclare block-scoped variable 'constants'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2076,18): error TS2300: Duplicate identifier 'TLSSocket'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2308,10): error TS2300: Duplicate identifier 'Utf8AsciiLatin1Encoding'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2309,10): error TS2300: Duplicate identifier 'HexBase64Latin1Encoding'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2310,10): error TS2300: Duplicate identifier 'Utf8AsciiBinaryEncoding'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2311,10): error TS2300: Duplicate identifier 'HexBase64BinaryEncoding'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2312,10): error TS2300: Duplicate identifier 'ECDHKeyFormat'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2449,22): error TS2420: Class 'Readable' incorrectly implements interface 'ReadableStream'.
Types of property 'setEncoding' are incompatible.
Type '(encoding: string) => void' is not assignable to type '{ (encoding: string): this; (encoding: string): void; }'.
Type 'void' is not assignable to type 'this'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2490,22): error TS2420: Class 'Duplex' incorrectly implements interface 'ReadWriteStream'.
Types of property 'pause' are incompatible.
Type '() => Duplex' is not assignable to type '() => ReadWriteStream'.
Type 'Duplex' is not assignable to type 'ReadWriteStream'.
Types of property 'setEncoding' are incompatible.
Type '(encoding: string) => void' is not assignable to type '{ (encoding: string): ReadWriteStream; (encoding: string): void; }'.
Type 'void' is not assignable to type 'ReadWriteStream'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2511,22): error TS2420: Class 'Transform' incorrectly implements interface 'ReadWriteStream'.
Types of property 'pause' are incompatible.
Type '() => Transform' is not assignable to type '() => ReadWriteStream'.
Type 'Transform' is not assignable to type 'ReadWriteStream'.
Types of property 'setEncoding' are incompatible.
Type '(encoding: string) => void' is not assignable to type '{ (encoding: string): ReadWriteStream; (encoding: string): void; }'.
Type 'void' is not assignable to type 'ReadWriteStream'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2536,5): error TS2300: Duplicate identifier 'export='.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2619,5): error TS2300: Duplicate identifier 'export='.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2641,18): error TS2300: Duplicate identifier 'Domain'.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2933,5): error TS2300: Duplicate identifier 'export='.
ERROR in C:\Users\Admin\ng2-project\typings\globals\node\index.d.ts
(2959,5): error TS2300: Duplicate identifier 'export='
After some googling and a little reading I've come to the conclusion that it's most likely not an issue with BrowserFS but rather with my typings.json, tsconfig.json, or some other unseen magical force in my project. I'll keep digging around but if you have anything helpful for me it would be much appreciated. Thanks!
To anyone who may come across this issue in the future: I resolved all error messages by removing the node
and dropboxjs
folders from /typings/globals/
I also removed the entries:
/// <reference path="globals/dropboxjs/index.d.ts" />
/// <reference path="globals/node/index.d.ts" />
from /typings/index.d.ts
Good luck!
typings.json
is the previous way to manage TypeScript typings using the typings
tool. Many folks now use the @types
NPM packages. AFAIK, typings is still supported, so what you are doing isn't wrong. I just misguided you with the new way of doing things.
Best of luck on your project!
Hello,
I'm trying to implement BrowserFS into my project in order to run unit tests on a script that reads and writes local files. When running
npm start
I'm getting a long list of errors at the end of the build process. Here's the outputHere's my Webpack config:
Am I missing something or doing something wrong? Any and all help is much appreciated, thank you!