I have already dialogflow installed, when I run the server I get this error:
Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v64-darwin-x64-unknown
Found: [node-v57-darwin-x64-unknown]
dialogflow version: 0.6.0I tried yarn install --force and it's not working.
Kindly note that I do not want to change my node version.
Greetings! Can you share your source code that's leading to this error? It looks like you may need to run npm rebuild
I get this error when I run my app. Here is the code
'use strict'
const dialogflow = require('dialogflow')
const projectId = process.env.DIALOGFLOW_PROJECT_ID
const sessionId = process.env.DIALOGFLOW_SESSION_ID
const intentsClient = new dialogflow.IntentsClient()
const agentPath = intentsClient.projectAgentPath(projectId)
module.exports = {
createIntent: (request: any, response: any) => {
const newIntentParams = {
displayName: request.query.intentName,
trainingPhrases: [ { type: 'EXAMPLE', parts: [{ text: request.query.sampleText }]} ],
mlEnabled: true,
responses: []
}
const intentObject = {
parent: agentPath,
intent: newIntentParams
}
intentsClient
.createIntent(intentObject)
.then(responses => {
return response.status(200).json({'Intent created': responses[0].displayName})
})
.catch(err => {
return response.status(404).json({'Error Message': err})
})
}
}
I tried yarn install --force which is similar to npm rebuild and it is not working.
@murgatroid99 @nicolasnoble I don't have any answers for this one scratches head what could cause this error?
Expected directory: node-v64-darwin-x64-unknown
Found: [node-v57-darwin-x64-unknown]
This means you've installed using node 8, but trying to run using node 10.
Yeah, as mentioned above - can you try npm rebuild?
So I just had a discussion about a similar issue, here: https://github.com/grpc/grpc-node/issues/564
@ahmad3m3: is the problem happening when you deploy on prod, and if yes, what's your deployment methodology? Do you run npm rebuild or npm install --production into your production environment, or do you simply copy all your local files from your development machine into your production machine?
Most helpful comment
This means you've installed using node 8, but trying to run using node 10.