简体   繁体   中英

Nestjs project cannot find module google-play-scrapper

I want to use this https://github.com/facundoolano/app-store-scraper , using NestJS project. Created the project using Nest new. already run yarn install and run the project using npm run start:dev .

Here is the error in my terminal:

    [Nest] 18464  - 01/12/2021, 4:14:13 pm   ERROR [ExceptionsHandler] Cannot find module 'google-play-scrapper'
Require stack:
- C:\Users\USER\Desktop\app-scrapper\dist\app.service.js
- C:\Users\USER\Desktop\app-scrapper\dist\app.controller.js
- C:\Users\USER\Desktop\app-scrapper\dist\app.module.js
- C:\Users\USER\Desktop\app-scrapper\dist\main.js
Error: Cannot find module 'google-play-scrapper'

I just followed sample code:

app.service.ts code

    import { Injectable } from '@nestjs/common';

@Injectable()
export class AppService {
  getHello(): string {
    var gplay = require('google-play-scrapper');
    gplay
      .app({ appId: 'com.google.android.apps.translate' })
      .then(console.log, console.log);

    return 'Hello World!';
  }
}

What Am I missing here? Thanks in advance!

do yarn add google-play-scraper and replace that
google-play-scrapper with
google-play-scraper

https://www.npmjs.com/package/google-play-scraper

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM