Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with dependencies #217

Closed
dormadekhin opened this issue May 19, 2018 · 16 comments
Closed

problem with dependencies #217

dormadekhin opened this issue May 19, 2018 · 16 comments
Assignees
Labels

Comments

@dormadekhin
Copy link

Short Description:
build error when using package

Platform:

  • ubuntu 16.04

node version:

  • v10.1.0 and v8.11.2

npm version:

  • 5.10.0 and 5.6.0

Long descrption
After each assembly produces an error:

These dependencies were not found:

* child_process in ./node_modules/shelljs/src/exec.js
* dgram in ./node_modules/native-dns-cache/lookup.js, ./node_modules/native-dns/lib/server.js and 1 other
* fs in ./node_modules/native-dns/lib/platform.js, ./node_modules/node-binance-api/node-binance-api.js and 20 others

To install them, you can run: npm install --save child_process dgram fs

code

const binance = require('node-binance-api');

set dependencies several times, tried different versions of nodejs, also tried to use yarn

thank you

@jaggedsoft jaggedsoft added the bug label May 19, 2018
@dmzoneill
Copy link
Collaborator

ill need to find another package to do DNS lookup or just right my own function.

currently the proxy package requires IP address instead of hostname, which is a bit ridiculous. need to resolve the hostname to IP using dns-lookup package.

@dmzoneill dmzoneill self-assigned this Jul 14, 2018
@dmzoneill
Copy link
Collaborator

@dormadekhin-denis
@jaggedsoft

these dependencies have been removed

@pujitm
Copy link

pujitm commented Jul 28, 2018

I'm having an extremely similar issue (same OS, similar error message). Should I open a new issue or keep it in this thread?

@jaggedsoft
Copy link
Owner

@DarthWindu which dependencies are not found?
are you trying it with --save?

npm install node-binance-api --save

@pujitm
Copy link

pujitm commented Jul 28, 2018

Yup, here's the error message:

ERROR  Failed to compile with 6 errors                                                    01:42:28

These dependencies were not found:

* dgram in ./node_modules/native-dns-cache/lookup.js, ./node_modules/native-dns/lib/server.js and 1 other
* fs in ./node_modules/native-dns/lib/platform.js, ./node_modules/node-binance-api/node-binance-api.js and 1 other

To install them, you can run: npm install --save dgram fs

And here's what I've tried in addition to running the command indicated in the error message:

  • reinstall node-binance, dgram, and fs
  • install with --save-dev (I installed it with --save the first time)
  • delete node_modules directory and run npm install

For some context, I'm integrating node-binance-api into a vuestic dashboard.

@jaggedsoft
Copy link
Owner

jaggedsoft commented Jul 28, 2018

This is weird, because 'fs' is a module built in to node.
Perhaps try npm install dgram -g
Would love to hear an update if you get it working

@pujitm
Copy link

pujitm commented Jul 29, 2018

I haven't gotten it working yet, but I tried to add the api to a new vuestic project and got the following error:

These dependencies were not found:

* dns in ./node_modules/socks-proxy-agent/index.js
* fs in ./node_modules/node-binance-api/node-binance-api.js, ./node_modules/request/lib/har.js
* net in ./node_modules/forever-agent/index.js, ./node_modules/https-proxy-agent/index.js and 4 others
* tls in ./node_modules/forever-agent/index.js, ./node_modules/https-proxy-agent/index.js and 2 others

after running npm install --save dns fs net tls and npm run dev, it reverts to the error message I posted earlier.

Edit: Also, it may a build issue (see this. I see webpack in my node_modules, but I don't see a config file at the root of the project directory, so I'm going to do some digging.

@pujitm
Copy link

pujitm commented Jul 29, 2018

I think I fixed it by adding

node: {
    fs: "empty",
    dgram: "empty"
  }

to module.exports in ./build/webpack.dev.conf.js .

I should confess, I have no idea why this worked.

@jonassunandar
Copy link

I think I fixed it by adding

node: {
    fs: "empty",
    dgram: "empty"
  }

to module.exports in ./build/webpack.dev.conf.js .

I should confess, I have no idea why this worked.

June 2019, the problem still occurs and this is the solution. Thanks @pujitm

@huynhpeter
Copy link

@jonassunandar I'm also getting the same error

@chtmorris
Copy link

chtmorris commented Sep 29, 2020

I am also having this issue. Specifically, I'm use Vue and am getting:

This dependency was not found:
* dns in ./node_modules/socks-proxy-agent/index.js

@joaquinnunez any ideas on a fix here in vuejs?
Importing the "dns" module then leads to another issue of failing to find "net"...

@jaggedsoft
Copy link
Owner

This seems to be an issue common to vue. I don't use vue so not familiar with the solution

@chtmorris
Copy link

Found a fix here. I created vue.config.js, stored in the project root. This file is automatically loaded by @vue/cli-service if it's present in your project root.

Complete file:

module.exports = {
    configureWebpack: {
        node: {
            fs: "empty",
            dgram: "empty",
            net: 'empty',
            tls: 'empty',
            dns: 'empty'
        }
    }
}

@jaggedsoft
Copy link
Owner

Thank you!

jaggedsoft added a commit that referenced this issue Sep 30, 2020
@xjohnwu
Copy link

xjohnwu commented Oct 15, 2020

I think the missing dependencies are due to the fact that vue is trying to call node-binance-api library on the browser-end, which doesn't have node libraries such as fs, dgram etc, because they are typically server-side libraries...
The solution is simply trying to keep all the node-binance-api calls only on the server side. I use nuxtjs framework with server api middleware. All node-binance-api calls are made via axios to the server api.

@CrazyBoy49z
Copy link

CrazyBoy49z commented Jan 17, 2021

npm -v
7.0.15
node -v
v15.4.0

 ERROR  Failed to compile with 6 errors                                                                                                             4:47:04 PM

These dependencies were not found:

* dgram in ./node_modules/native-dns-cache/lookup.js, ./node_modules/native-dns/lib/server.js and 1 other
* fs in ./node_modules/native-dns/lib/platform.js, ./node_modules/node-binance-api/node-binance-api.js and 1 other

To install them, you can run: npm install --save dgram fs
 8 assets

WARNING in ./node_modules/defaultable/defaultable.js 49:13-31
Critical dependency: the request of a dependency is an expression
 @ ./node_modules/hbo-dnsd/server.js
 @ ./node_modules/hbo-dnsd/named.js
 @ ./node_modules/dns/lib/dns.js
 @ ./node_modules/socks-proxy-agent/index.js
 @ ./node_modules/node-binance-api/node-binance-api.js
 @ ./resources/js/binance.js
 @ multi ./resources/js/binance.js

ERROR in ./node_modules/native-dns-cache/lookup.js
Module not found: Error: Can't resolve 'dgram' in '/Users/macbook/projects/finiv/node_modules/native-dns-cache'
 @ ./node_modules/native-dns-cache/lookup.js 21:12-28
 @ ./node_modules/native-dns-cache/index.js
 @ ./node_modules/native-dns/lib/platform.js
 @ ./node_modules/native-dns/dns.js
 @ ./node_modules/dns/lib/dns.js
 @ ./node_modules/socks-proxy-agent/index.js
 @ ./node_modules/node-binance-api/node-binance-api.js
 @ ./resources/js/binance.js
 @ multi ./resources/js/binance.js

ERROR in ./node_modules/native-dns/lib/server.js
Module not found: Error: Can't resolve 'dgram' in '/Users/macbook/projects/finiv/node_modules/native-dns/lib'
 @ ./node_modules/native-dns/lib/server.js 23:12-28
 @ ./node_modules/native-dns/dns.js
 @ ./node_modules/dns/lib/dns.js
 @ ./node_modules/socks-proxy-agent/index.js
 @ ./node_modules/node-binance-api/node-binance-api.js
 @ ./resources/js/binance.js
 @ multi ./resources/js/binance.js

ERROR in ./node_modules/native-dns/lib/utils.js
Module not found: Error: Can't resolve 'dgram' in '/Users/macbook/projects/finiv/node_modules/native-dns/lib'
 @ ./node_modules/native-dns/lib/utils.js 21:12-28
 @ ./node_modules/native-dns/lib/platform.js
 @ ./node_modules/native-dns/dns.js
 @ ./node_modules/dns/lib/dns.js
 @ ./node_modules/socks-proxy-agent/index.js
 @ ./node_modules/node-binance-api/node-binance-api.js
 @ ./resources/js/binance.js
 @ multi ./resources/js/binance.js

ERROR in ./node_modules/native-dns/lib/platform.js
Module not found: Error: Can't resolve 'fs' in '/Users/macbook/projects/finiv/node_modules/native-dns/lib'
 @ ./node_modules/native-dns/lib/platform.js 23:9-22
 @ ./node_modules/native-dns/dns.js
 @ ./node_modules/dns/lib/dns.js
 @ ./node_modules/socks-proxy-agent/index.js
 @ ./node_modules/node-binance-api/node-binance-api.js
 @ ./resources/js/binance.js
 @ multi ./resources/js/binance.js

ERROR in ./node_modules/node-binance-api/node-binance-api.js
Module not found: Error: Can't resolve 'fs' in '/Users/macbook/projects/finiv/node_modules/node-binance-api'
 @ ./node_modules/node-binance-api/node-binance-api.js 16:17-32
 @ ./resources/js/binance.js
 @ multi ./resources/js/binance.js

ERROR in ./node_modules/request/lib/har.js
Module not found: Error: Can't resolve 'fs' in '/Users/macbook/projects/finiv/node_modules/request/lib'
 @ ./node_modules/request/lib/har.js 3:9-22
 @ ./node_modules/request/request.js
 @ ./node_modules/request/index.js
 @ ./node_modules/node-binance-api/node-binance-api.js
 @ ./resources/js/binance.js
 @ multi ./resources/js/binance.js
npm ERR! code 2
npm ERR! path /Users/macbook/projects/finiv
npm ERR! command failed
npm ERR! command sh -c cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/macbook/.npm/_logs/2021-01-17T14_47_16_058Z-debug.log
npm ERR! code 2
npm ERR! path /Users/macbook/projects/finiv
npm ERR! command failed
npm ERR! command sh -c npm run production

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/macbook/.npm/_log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants