drawrowfly / amazon-product-api

Amazon Scraper. Scrape products from the amazon search result or reviews from the specific product
627 stars 181 forks source link

Not able to load module 'amazon-buddy' in my js code #66

Closed Akshitjariwala closed 2 years ago

Akshitjariwala commented 2 years ago

I am not able to load the 'amazon-buddy' module in my code and it is always giving 'Could not find module 'amazon-buddy''. Even though i ran the npm command mentioned on the site to load the package. Could you please help ?

drawrowfly commented 2 years ago

Not package related problem

cvanvlack commented 2 years ago

@Akshitjariwala, Did you ever solve this? I was searching how to get this running and I thought I would put what I had here.

I'm using firebase functions. In the functions directory, I ran

npm i amazon-buddy

My code is

import * as functions from "firebase-functions";
import * as amazonbuddy from "amazon-buddy";

export const searchForProducts =
  functions.https.onCall(async (data, context) => {

    const options = {
      keyword: "vacuum cleaner",
    };

    const output = await amazonbuddy.products(options);
    console.log(output);
    return output;
  });
Akshitjariwala commented 2 years ago

Try deleting the node_modules folder and do the 'npm install' once again to install and load all the dependencies from scratch. That worked for me.