Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Make it work with Angular #72

Closed
ranouf opened this issue May 3, 2018 · 3 comments
Closed

Make it work with Angular #72

ranouf opened this issue May 3, 2018 · 3 comments
Assignees
Labels
api: speech Issues related to the googleapis/nodejs-speech API. type: question Request for information or clarification. Not an issue. web

Comments

@ranouf
Copy link

ranouf commented May 3, 2018

Hi,

I installed the npm package:

npm install --save @google-cloud/speech

I m curious to know if it possible to make it work with Angular 5 and how to do it?

I read an article about including a js library in an angular project:
https://hackernoon.com/how-to-use-javascript-libraries-in-angular-2-apps-ff274ba601af

But when I add this code:

import * as _ from '@google-cloud/speech';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'app';

  constructor() {
   const client = new _.speech.SpeechClient();
}

With npm start I have this error:

ERROR in ./node_modules/google-gax/lib/operations_client.js
Module not found: Error: Can't resolve './operations_client_config' in 'GoogleSpeechTest\src\client\node_modules\google-gax\lib'
ERROR in ./node_modules/google-gax/index.js
Module not found: Error: Can't resolve './package' in 'GoogleSpeechTest\src\client\node_modules\google-gax'
ERROR in ./node_modules/@google-cloud/speech/src/v1/speech_client.js
Module not found: Error: Can't resolve './speech_client_config' in 'GoogleSpeechTest\src\client\node_modules@google-cloud\speech\src\v1'
ERROR in ./node_modules/@google-cloud/speech/src/v1p1beta1/speech_client.js
Module not found: Error: Can't resolve './speech_client_config' in 'GoogleSpeechTest\src\client\node_modules@google-cloud\speech\src\v1p1beta1'
ERROR in ./node_modules/gtoken/node_modules/mime/index.js
Module not found: Error: Can't resolve './types/other' in 'GoogleSpeechTest\src\client\node_modules\gtoken\node_modules\mime'
ERROR in ./node_modules/gtoken/node_modules/mime/index.js
Module not found: Error: Can't resolve './types/standard' in 'GoogleSpeechTest\src\client\node_modules\gtoken\node_modules\mime'
ERROR in ./node_modules/detect-libc/lib/detect-libc.js
Module not found: Error: Can't resolve 'child_process' in 'GoogleSpeechTest\src\client\node_modules\detect-libc\lib'
ERROR in ./node_modules/google-auth-library/build/src/auth/googleauth.js
Module not found: Error: Can't resolve 'child_process' in 'GoogleSpeechTest\src\client\node_modules\google-auth-library\build\src\auth'

@ranouf
Copy link
Author

ranouf commented May 7, 2018

Hi,

Is there someone who can help me?

@stephenplusplus
Copy link
Contributor

This issue on our common repo might help get past some hurdles, but unfortunately, our client libraries are not designed with browser compatibility in mind.

@stephenplusplus stephenplusplus added the type: question Request for information or clarification. Not an issue. label May 8, 2018
@google-cloud-label-sync google-cloud-label-sync bot added the api: speech Issues related to the googleapis/nodejs-speech API. label Jan 31, 2020
@avinash9008
Copy link

@ranouf

please help me i am also facing same issue with npm install --save @google-cloud/speech in angular

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api: speech Issues related to the googleapis/nodejs-speech API. type: question Request for information or clarification. Not an issue. web
Projects
None yet
Development

No branches or pull requests

4 participants