hildjj / node-cbor

Encode and decode CBOR documents, with both easy mode, streaming mode, and SAX-style evented mode.
MIT License
357 stars 73 forks source link

Module not found: Error: Can't resolve 'stream' #132

Closed badboy-huaqiao closed 3 years ago

badboy-huaqiao commented 3 years ago

Angular11

Error: ./node_modules/cbor/lib/commented.js Module not found: Error: Can't resolve 'stream' in '/Users/..../node_modules/cbor/lib'

hildjj commented 3 years ago

add stream-browserify as a dependency your project?

hildjj commented 3 years ago

See https://github.com/Richienb/node-polyfill-webpack-plugin/blob/master/index.js for other things you might need.

badboy-huaqiao commented 3 years ago

@hildjj my project is angular11 and using ng-cli init my project, so your mean that I need use npm install stream-browserify ? is that right?

hildjj commented 3 years ago

See https://github.com/hildjj/node-cbor/pull/130#issuecomment-770284674 for the conversation we're having about how to make this work today, and what we might do to make it easier.

badboy-huaqiao commented 3 years ago

@hildjj ok, great thanks, I wish that works after your PR is merged.

hildjj commented 3 years ago

cbor-web is now published at version 7.0.0, it's what you want.