Nodejs-dialogflow: Expected directory: node-v64-darwin-x64-unknown Found: [node-v57-darwin-x64-unknown]

Created on 19 Sep 2018  路  6Comments  路  Source: googleapis/nodejs-dialogflow

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]

Environment details

  • OS: MacOS High Sierra
  • OS version: 10.13.4
  • Node.js version: 8.11.3
  • yarn version: 1.9.2
  • dialogflow version: 0.6.0

I tried yarn install --force and it's not working.

Kindly note that I do not want to change my node version.

question needs more info dialogflow

Most helpful comment

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.

All 6 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BenjaminHoegh picture BenjaminHoegh  路  7Comments

avallone-google picture avallone-google  路  3Comments

pariola picture pariola  路  4Comments

Knowledge91 picture Knowledge91  路  7Comments

harshan89 picture harshan89  路  6Comments