Open kjanoudi opened 5 years ago
What kind of issues are you seeing?
When trying to build with yarn on node 8:
@matthewayne error dialogflow-fulfillment@0.6.1: The engine "node" is incompatible with this module. Expected version "6". Got "8.12.0"
What is your environment/how are you installing/importing the library?
I have it as a dependency in a GCP hosted cloud function deployed by serverless with webpack. It serves as fulfillment to a dialogflow agent without using actions on Google or the Google assistant.
@kjanoudi Cloud Firebase only allows for "node" to either be "6" or "8". Not "8.12.0", I hope that helps
@kjanoudi I take it your cloud function is using node 8?
@matthewayne correct. @sarahdwyer it does not work with 8 either.
Is there any particular feature or requirement that is not supported by Node 8 and would expand this change by more than just a package.json
modification?
I have basically the same error when trying to add it to a custom node server:
error dialogflow-fulfillment@0.6.1: The engine "node" is incompatible with this module. Expected version "6". Got "10.8.0"
@kjanoudi Cloud Firebase works fine for me with Node: "8", can you post all of your dependencies?
@sarahdwyer
"dialogflow": "^0.7.0",
"dialogflow-fulfillment": "^0.6.1",
"firebase-admin": "^6.0.0",
"humanize-duration": "^3.15.3",
"uuid": "^3.3.2"
It works fine with this change: https://github.com/dialogflow/dialogflow-fulfillment-nodejs/pull/157/files
However, without it, I get error dialogflow-fulfillment@0.6.1: The engine "node" is incompatible with this module. Expected version "6". Got "8.12.0"
Any progress on this? @sarahdwyer
Same error on my side:
error dialogflow-fulfillment@0.6.1: The engine "node" is incompatible with this module. Expected version "6". Got "8.10.0"
Here is the package.json I downloaded (had to move to node6 to fetch it)
{
"name": "dialogflow-fulfillment",
"description": "Dialogflow Fulfillment Library for Node.js",
"main": "src/dialogflow-fulfillment.js",
"version": "0.6.1",
"license": "Apache-2.0",
"author": "Google Inc.",
"directories": {
"test": "test"
},
"engines": {
"node": "6"
},
"scripts": {
"test": "npm run lint && ava",
"lint": "eslint --fix \"src/**/*.js\" \"test/*.js\" \"script/*.js\"",
"docs": "node ./generateDocs.js",
"zip": "npm run zip:actions-on-google && npm run zip:multilocale && npm run zip:temperature-converter && npm run zip:quick-start",
"zip:actions-on-google": "node ./script/generateZip.js --indexjs ./samples/actions-on-google/functions/index.js --packagejson ./samples/actions-on-google/functions/package.json --agentzip ./samples/actions-on-google/actions-on-google-agent.zip",
"zip:multilocale": "node ./script/generateZip.js --indexjs ./samples/multi-lang-and-locale/functions/index.js --packagejson ./samples/multi-lang-and-locale/functions/package.json --agentzip ./samples/multi-lang-and-locale/multilocale-agent.zip",
"zip:temperature-converter": "node ./script/generateZip.js --indexjs ./samples/parameters-contexts-and-rich-responses/functions/index.js --packagejson ./samples/parameters-contexts-and-rich-responses/functions/package.json --agentzip ./samples/parameters-contexts-and-rich-responses/temperature-converter-agent.zip",
"zip:quick-start": "node ./script/generateZip.js --indexjs ./samples/quick-start/functions/index.js --packagejson ./samples/quick-start/functions/package.json --agentzip ./samples/quick-start/quickstart-agent.zip"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dialogflow/dialogflow-fulfillment-nodejs.git"
},
"bugs": {
"url": "https://github.com/dialogflow/dialogflow-fulfillment-nodejs/issues"
},
"homepage": "https://github.com/dialogflow/dialogflow-fulfillment-nodejs#readme",
"keywords": [
"dialogflow",
"api.ai",
"client library",
"webhook",
"fulfillment"
],
"dependencies": {
"debug": "^3.1.0",
"lodash": "^4.17.11"
},
"peerDependencies": {
"actions-on-google": "^2.4.1"
},
"devDependencies": {
"ava": "^0.24.0",
"eslint": "^4.15.0",
"eslint-config-google": "^0.9.1",
"jsdoc-to-markdown": "^4.0.1",
"jszip": "^3.1.5",
"commander": "^2.15.1"
}
}
I believe the change was made (see below), but the npm package wasn't updated, still using hardcoded node 6 version.
https://github.com/dialogflow/dialogflow-fulfillment-nodejs/blob/master/package.json#L12
@matthewayne @kjanoudi I believe releasing a new npm version would just fix this issue :)
Workaround:
yarn add dialogflow-fulfillment actions-on-google --ignore-engines
Hi @Vadorequest you're running that workaround on a custom server correct? (i.e not Cloud Functions?)
@sarupbanskota Yes, I'm running my function on AWS Lambda
The workaround is executed on my personal computer, I use the Serverless Framework to deploy the stack. (if you're not familiar with SLS framework, just consider that I do the build on my computer, then deploy that build on AWS, which is similar with having a custom server)
The workaround can be used both on personal computers (localhost, development env) and on a server (production env)
I do not know how to skip "engines" check on Firebase, but if you deploy on AWS/GCP/Azure, the workaround should be the same.
The workaround can be used both on personal computers (localhost, development env) and on a server (production env)
Indeed; I was looking for a way to use the yarn flag on a Firebase deployment.
Haven't used it yet, but I like the idea of deploying a local build via SLS Framework - more predictable. Will give it a try - thanks!
Can we get a new npm release for this? I see it's fixed in master
The best workaround I've found isn't the --ignore-engines
but simply changing the path for the package in package.json
"dialogflow-fulfillment": "dialogflow/dialogflow-fulfillment-nodejs",
Avoids additional issues.
Thanks for the solution, yet this is causing error in my google cloud build.
Can the package.json modified so we don't need to use --ignore-engines ?
I suffer from this problem too. Can`t deploy to firebase functions using firebase-cli. Only installing it from master branch directly from repository helps.
Solved it by installing packages
Just do yarn add
or npm install
and any of the above packages.
How is this still a problem, @matthewayne, with 118cfa083c38fdb938c8d0d4452eca6d4df69b35 now in master? Is the npm
module being neglected?
I imagine my use-case is similar to others: I develop on a 10.x
or 12.x
Node.js locally, and copy those versions to my production server.
@ajays97, your fix is almost perfect - at least from a yarn
perspective:
I couldn't do an yarn add dialogflow-fulfillment/dialogflow-fulfillment-nodejs
, instead I just dropped that link in my package.json
and did a yarn install
.
i managed to install the 2 packages (dialogflow-fulfillment and actions-on-google) successfully using the following yarn command in terminal...
yarn add https://github.com/dialogflow/dialogflow-fulfillment-nodejs
yarn add actions-on-google
@myhendry This should have worked too. https://github.com/dialogflow/dialogflow-fulfillment-nodejs/issues/156#issuecomment-442795321
Thanks Vadorequest. However will inserting the flag --ignore-engines cause problems when deploying to heroku or aws?
No, it won't. That flag basically means you're ignoring the engine check, nothing more. So, even if it's specified in the package that it's not compatible with node 6, then it will passe the engine check even if installing using node !6. It doesn't change the behaviour of node whatsoever, it's only related to the package installation sanity checks. :)
Thanks @Vadorequest for the clarification
Is there a replacement for the associated NPM Module? It is 2020 and I getting the same error. This repo hasn't been touched in 2+ years.
Some dependencies could not be validated. The node version for dialogflow-fulfillment package is incompatible.
Is there a replacement we should be using from Google or is this just not being maintained anymore and their is no replacement? The Google documentation leads you here, which makes it quite confusing.
@alankleindev, does this serve your purposes better?
I've not made a voice agent in a while, I was just dipping in to see what's changed - turns out nothing (sadly). I did find that package though and it's updated information.
Thanks @vSanjo. I was looking for a library so I didn't have to manually construct the JSON response, as detailed here.
{
"fulfillmentMessages": [
{
"text": {
"text": [
"Text response from webhook"
]
}
}
]
}
I looked at Dialogflow API: Node.js Client, but it seems to not have the methods to do so, compared to dialogflow-fulfillment-nodejs, but i could be overseeing it. Basically, was looking for a more steamlined way to create the Webhook fulfullment responses instead of manually constructing JSON.
Thanks for pointing out this repo though.
It seems like about 2 years ago, most of the effort into creating content for Dialogflow dropped off, based on what I see published.
I can only agree with you, @alankleindev. I've had similar experiences and thankfully not needed to put much energy into exploring it just yet - but I will soon, I imagine.
On the one hand, creating them ourselves seems to be the 'expected' way moving forwards. It's almost purer, precise and extendable without opinion from other modules. On the other hand, it's so much more extra work facilitating that change, especially if you're doing it from scratch.
Your point about the effort for creating new things for DialogFlow dropping off is accurate and saddening. I'd love to explore why that's happening and where that effort has shifted to.
Good luck moving over!
This line should be
"node": ">=6.0.0"
, it's causing issues with deploying to engines based on node 8 and up. Not sure why it was changed here: https://github.com/dialogflow/dialogflow-fulfillment-nodejs/commit/b8028247b849d7dea2d2e303a88ef109a0f0aa58#diff-b9cfc7f2cdf78a7f4b91a753d10865a2https://github.com/dialogflow/dialogflow-fulfillment-nodejs/blob/5994311c2155b2571a6de50250665e18d5d375f8/package.json#L12