kylefarris / clamscan

A robust ClamAV virus scanning library supporting scanning files, directories, and streams with local sockets, local/remote TCP, and local clamscan/clamdscan binaries (with failover).
MIT License
236 stars 69 forks source link

Error when try to build #22

Closed willderazevedo closed 5 years ago

willderazevedo commented 6 years ago

When I try to build my Laravel project with clamscan running npm run dev, i get an error:

Module not found: Error: Can't resolve 'child_process'.

So i put in webpackconfig this: node: { child_process: 'empty' }

and i get another error:

Module not found: Error: Can't resolve 'fs'.

Then i put in webpackconfig:

node: { child_process: 'empty', fs: 'empty' }

and i get the error: fs.existsSync is not a function

please tell me whats is going on, and what i have to do

kylefarris commented 5 years ago

You can't webpack this module as its intended to run server side where NodeJS is fully available. The fs module it's saying can't be resolved is a built-in NodeJS library (https://nodejs.org/dist/latest-v11.x/docs/api/fs.html)