-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to compile #25
Comments
any solutions for this? I've tried installing missing packages manually through npm but same error ocurs |
It seems it only affects Windows users. I did the same as well but it didn't work either, so I used JavaScript repo and it worked. |
Yeah bro same here. But " JavaScript repo " they said not to use it and use the clarifai-nodejs-grpc. |
Is this issue still occurring for folks? I'm able to successfully connect, authenticate and make a call with the following snippet (modified the README getting started code a bit to get it to work) const {grpc} = require("clarifai-nodejs-grpc");
const service = require("clarifai-nodejs-grpc/proto/clarifai/api/service_pb");
const resources = require("clarifai-nodejs-grpc/proto/clarifai/api/resources_pb");
const {StatusCode} = require("clarifai-nodejs-grpc/proto/clarifai/api/status/status_code_pb");
const {V2Client} = require("clarifai-nodejs-grpc/proto/clarifai/api/service_grpc_pb");
const metadata = new grpc.Metadata();
metadata.set("authorization", "Key YOUR_KEY_HERE");
const clarifai = new V2Client("api.clarifai.com", grpc.ChannelCredentials.createSsl());
const request = new service.PostModelOutputsRequest();
request.setUserAppId(new resources.UserAppIDSet().setUserId("clarifai").setAppId("main"))
request.setModelId("general-image-recognition");
request.addInputs(
new resources.Input()
.setData(
new resources.Data()
.setImage(
new resources.Image()
.setUrl("https://samples.clarifai.com/dog2.jpeg")
)
)
)
clarifai.postModelOutputs(
request,
metadata,
(err, response) => {
if (err) {
console.log("Error: " + err);
return;
}
if (response.getStatus().getCode() !== StatusCode.SUCCESS) {
throw "Error: " + response.getStatus();
}
console.log("Predicted concepts, with confidence values:")
for (const concept of response.getOutputsList()[0].getData().getConceptsList()) {
console.log(concept.getName() + " " + concept.getValue());
}
}
); If this is still an issue, please provide more info, and I can try to reproduce. For reference, I'm using node v16.13.1, I did
|
Hi I'm a window user and I'm having the same issue, may you please provide another solution? |
Hi
After importing the clarifai-nodejs-grpc package, I get this error:
./node_modules/@grpc/grpc-js/build/src/server.js
Module not found: Can't resolve 'http2' in 'C:\Users\Nene\Desktop\WebWork\face-recognition-app\node_modules@grpc\grpc-js\build\src'
Thanks
The text was updated successfully, but these errors were encountered: