question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find name 'Buffer'.)

See original GitHub issue

Hi, I am running @angular.cli rc.0 and getting the following error with ng-serve


J:/workspace/angular2/ts/epimss/node_modules/ng2-smart-table/src/ng2-smart-table/lib/helpers.ts (3,20): Cannot find name 'Buffer'.)
J:/workspace/angular2/ts/epimss/node_modules/ng2-smart-table/src/ng2-smart-table/lib/helpers.ts (10,22): Cannot find name 'Buffer'.)
J:/workspace/angular2/ts/epimss/node_modules/ng2-smart-table/src/ng2-smart-table/lib/helpers.ts (11,17): Cannot find name 'Buffer'.)

in helpers (..\node_modules\ng2-smart-table\src\ng2-smart-table\lib\helpers.ts)s the Buffer has an assocated error of "Cannot find name 'Buffer'." 

Webstorm displays the following hints at correction:

![image](https://cloud.githubusercontent.com/assets/3227590/23519885/8cae6aea-ff46-11e6-9aa2-833a2c19f7b8.png)

How can I overcome this issue?

Thanks


Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
kjetilhpcommented, Mar 9, 2017

at least declare var Buffer: any; in typings.d.ts removes the error

4reactions
PrazSamcommented, Mar 10, 2017

I am running @angular.cli rc.1 and removed this error adding "types": ["node"] in to tsconfig.app.json

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting error TS2304: Cannot find name 'Buffer' - Stack Overflow
I am trying to do base64 encode in NodeJS using TypeScript. Following code working fine in JavaScript. When I am writing same thing...
Read more >
Typescript error: Cannot find name 'Buffer'/'http'/'https' #1271
So, I was able to reproduce your issue. You actually need to add "types": ["node"] to the tsconfig.app.json file that the angular-cli creates...
Read more >
cannot find name 'buffer'. do you need to install type ...
To solve the Cannot find name require error, install the `node` types by running `npm i -D @types/node`. If the error is not...
Read more >
Buffer | Node.js v19.3.0 Documentation
When decoding a Buffer into a string that does not exclusively contain valid ... The name of this encoding can be very misleading,...
Read more >
3xt9a39dr - TypeScript - OneCompiler
Try `npm i @types/node`. script.ts(212,9): error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found