Discussion:
[nodejs] Cannot find name 'require'
KyawMyoKhant Khant
2018-07-14 08:33:21 UTC
Permalink
I had already installed the google-cloud/speech using the command line npm
install --save @google-cloud/speech.

However, I am receving error saying Cannot find name 'require' in my code
.ts const speech = require('@google-cloud/speech');

I am new to this. Can anyone give me a solution.

Thank You
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/60b4b914-5f5d-4858-8d72-be41324504b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Priyanka Chaturvedi
2018-07-16 07:19:36 UTC
Permalink
remove the quotes.
for if npm's name is fs, you should write:

var fs = require(fs);
Post by KyawMyoKhant Khant
I had already installed the google-cloud/speech using the command line npm
However, I am receving error saying Cannot find name 'require' in my code
I am new to this. Can anyone give me a solution.
Thank You
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/433b3b58-2f35-458a-abbd-b22adfc2cb29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Zlatko
2018-07-16 06:21:16 UTC
Permalink
To avoid a lot of typing, this is a known thing with TypeScript config, so
take a look at this answer: https://stackoverflow.com/a/35961176/162070

It most likely is the answer you're looking for.

Zlatko
Post by KyawMyoKhant Khant
I had already installed the google-cloud/speech using the command line npm
However, I am receving error saying Cannot find name 'require' in my code
I am new to this. Can anyone give me a solution.
Thank You
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/532848a9-cb51-4a4e-af26-dd0f724ea2cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...