0

In my project (using the ionic-framework 3) I have used following statement to require the dialogflow module:

const dialogflow = require('dialogflow');

On compilation it's throwing the following error:

cannot find name 'require'.

How can I resolve this?

2
  • 1
    import * as dialogflow from 'dialogflow';? Commented Oct 3, 2018 at 14:12
  • I haven't imported that. Is it the same way I have to write as you have written? Commented Oct 3, 2018 at 14:29

1 Answer 1

0

Add types to tsconfig.json

"types": [
    "node"
],
"typeRoots": [
    "node_modules/@types"
]
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.