marcopiraccini / electron-usb

node-usb fork to be used with electron. It's a fork from node-usb
MIT License
36 stars 9 forks source link

How to integrate this with Angular 6? #6

Open ghost opened 5 years ago

ghost commented 5 years ago

I would like to use this in my Angular 6 service provider, but not sure how. I tried to include it in several ways but none of them seem to be working.

I tried:

  1. this.usb = this.electronService.remote.require('electron-usb');
  2. * as usb from 'electron-usb';
  3. this.usb = require('electron-usb')

Ofcourse I have installed the npm electron usb package by nmp install usb but I still get the error: Error: Cannot find module 'electron-usb'

zhanls commented 4 years ago

I would like to use this in my Angular 6 service provider, but not sure how. I tried to include it in several ways but none of them seem to be working.

I tried:

  1. this.usb = this.electronService.remote.require('electron-usb');
  2. * as usb from 'electron-usb';
  3. this.usb = require('electron-usb')

Ofcourse I have installed the npm electron usb package by nmp install usb but I still get the error: Error: Cannot find module 'electron-usb'

Have you got any progress from then on ? I met a similar problem where I installed node-usb on electron-v6.0.0. But failed to require the package instantly. And the problem leads me to here...