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

Cannot find module './build/Debug/DTraceProviderBindings' #1915

Closed
alansouzati opened this issue Nov 17, 2016 · 37 comments
Closed

Cannot find module './build/Debug/DTraceProviderBindings' #1915

alansouzati opened this issue Nov 17, 2016 · 37 comments

Comments

@alansouzati
Copy link

@alansouzati alansouzati commented Nov 17, 2016

I'm using version 0.17.3. If I run npm install everything works fine. The problem only shows up when I do yarn install.

Do you want to request a feature or report a bug?
Report a bug

What is the current behavior?

After doing yarn install and start a development server with webpack and react-hot-loader, I get a bunch of module not found issues like this:

{ Error: Cannot find module './build/default/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/alansouza/repo/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }

What is the expected behavior?

Module is found and no error is printed

Please mention your node.js, yarn and operating system version.

Node 6.9.1
NPM 3.10.9

@wyze wyze added the needs triage label Nov 18, 2016
@hustcer

This comment has been minimized.

Copy link

@hustcer hustcer commented Nov 18, 2016

I have exactly the same issue
node@v7.1.0,yarn@0.17.4,macOS@10.12.1

@ladz

This comment has been minimized.

Copy link

@ladz ladz commented Jan 19, 2017

Same behaviour here.

  • macOS@10.12.1
  • node@6.9.2
  • yarnv@0.19.1 (installed via brew)
  • npm@3.10.9

Full error message

{ Error: Cannot find module './build/Release/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/commons-express/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:570:32)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/default/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/commons-express/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:570:32)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/commons-express/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:570:32)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Release/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/bunyan-logstash-tcp/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:570:32)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/default/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/bunyan-logstash-tcp/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:570:32)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12) code: 'MODULE_NOT_FOUND' }
{ Error: Cannot find module './build/Debug/DTraceProviderBindings'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/node_modules/bunyan-logstash-tcp/node_modules/dtrace-provider/dtrace-provider.js:17:23)
    at Module._compile (module.js:570:32)
    at Module._extensions..js (module.js:579:10)
    at Object.require.extensions.(anonymous function) [as .js] (/node_modules/babel-register/lib/node.js:152:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12) code: 'MODULE_NOT_FOUND' }
@chenyaoli19

This comment has been minimized.

Copy link

@chenyaoli19 chenyaoli19 commented Jan 29, 2017

Looks like the issue hasn't been resolved yet?
I have the same issue.
Mac OX@Sierra 10.12.3
Node@7.4.0
npm@4.0.5

@ecwyne

This comment has been minimized.

Copy link

@ecwyne ecwyne commented Jan 29, 2017

I believe this happens when there are two different versions of dtrace-provider as dependencies. Use yarn list to print a full graph of dependencies. In my project I had sub-dependencies of dtrace-provider 0.6.0 & 0.8.0

yarn appears to only build ONE of those dependencies and does not build the other.

@priyanka100894

This comment has been minimized.

Copy link

@priyanka100894 priyanka100894 commented Jan 30, 2017

Same behavior here

E/configParser - Error code: 105
[15:17:20] E/configParser - Error message: failed loading configuration file conf.js
[15:17:20] E/configParser - Error: Cannot find module 'C:\Users\priyanka.pasalkar\Desktop\ng2-e2e-testing-tutorial
-master\ng2-e2e-testing-tutorial-master\conf.js'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at ConfigParser.addFileConfig (C:\Users\priyanka.pasalkar\AppData\Roaming\npm\node_modules\protractor\built\co
nfigParser.js:123:26)
at Object.initFn [as init] (C:\Users\priyanka.pasalkar\AppData\Roaming\npm\node_modules\protractor\built\launc
her.js:92:22)
at Object. (C:\Users\priyanka.pasalkar\AppData\Roaming\npm\node_modules\protractor\built\cli.js:209
:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)

@chenyaoli19

This comment has been minimized.

Copy link

@chenyaoli19 chenyaoli19 commented Jan 30, 2017

For anyone who's interested, I managed to resolve this issue by downgrading my node version from node@7.4 to node@6 and it started working for me...

@jmenglis

This comment has been minimized.

Copy link

@jmenglis jmenglis commented Feb 2, 2017

Interesting. I am running on node@6.9.4 currently and I am seeing this issue. I added the package passport and passport-facebook. I removed both dependencies and added them back. Now the dtrace-provider error has mysteriously disappeared.

@springuper

This comment has been minimized.

Copy link

@springuper springuper commented Feb 8, 2017

same issue appears me

yarn: 0.17.9
node: 6.9.1
os: mac 10.12.1

@jgliner

This comment has been minimized.

Copy link

@jgliner jgliner commented Feb 8, 2017

For those who are still having this issue, I was able to resolve it by switching to the native version of Yarn (@0.19.1 as of posting, installed via homebrew) instead of the global npm module.

I was also using nvm at the time to install/manage my node versions, so I decided to wipe node/nvm from my system and install node with homebrew instead. That seemed to do the trick.

Here is my current system:
node@7.5.0
npm@4.1.2
yarn@0.19.1
macOS@10.12.4

@lecstor

This comment has been minimized.

Copy link

@lecstor lecstor commented Mar 1, 2017

I just had similar errors when running jest tests for a new yarn install. yarn cache clean && rm -rf node_modules && yarn appears to have mysteriously resolved them.. tests run clean now..

  console.error node_modules/dtrace-provider/dtrace-provider.js:26
    { Error: Cannot find module './build/Release/DTraceProviderBindings' from 'dtrace-provider.js'

node@6.10.0
yarn@0.21.3
macOS@10.12.3

@ladz

This comment has been minimized.

Copy link

@ladz ladz commented Mar 2, 2017

@lecstor Just followed your steps yarn cache clean && rm -rf node_modules && yarn. I still get the error mentioned in the comments above.
But I do have two different versions of dtrace-providerin the dependencies (as mentioned here)

dtrace-provider@0.8.0 and
dtrace-provider@0.7.1

I will try to change this and comment the results here.

node@v7.7.1
yarn@0.21.3
macOS@10.12.3

@xdissent

This comment has been minimized.

Copy link
Contributor

@xdissent xdissent commented Mar 17, 2017

I did some sleuthing to get to the bottom of this, and I'm happy to report it's not really yarn's fault. There are a handful of issues with dtrace-provider that could break things in interesting ways.

The first issue is with the dtrace-provider install script and how it runs node-gyp. It looks for the node-gyp binary in a few predefined locations, which, depending on your environment, may fail or find the wrong binary. This is likely why some people are having problems under nvm or nodenv (although my nodenv setup seems to work).

If it fails to find node-gyp, it just bails. The exit code is zero, so yarn has no idea the command failed and just keeps on truckin. That explains why everything seems to work at compile time. It will also explicitly exit with code 0, even if the build failed. So again, yarn thinks everything's fine.

Then, the runtime js module actually catches the require() error when it can't find the native module. It just logs the Error: Cannot find module './build/default/DTraceProviderBindings' warning and carries on.

Things get hairier with node >= 6 and dtrace-provider@0.6.0, because dtrace-provider depends on nan@^2.0.8. If you just yarn add dtrace-provider@0.6.0 in a new project, you'll get nan@2.5.1, which works fine. But if you already have a dep on nan that has resolved to some version < 2.2.x, you'll get the following error when building dtrace-provider: ../../nan/nan.h:590:20: error: no type named 'GCEpilogueCallback' in 'v8::Isolate'. Upgrading to dtrace-provider@^0.7.0 ensures it gets a working nan version.

So, yarn seems to be doing the right thing. The biggest problem is that dtrace-provider is silencing its errors completely. If it didn't, yarn would have at least told you it failed. In my case, I only have an optional dep on it anyway, so that would have been great. I'll file some issues in that repo to address all that.

Where yarn could have been more helpful is with build logging (#2204). I had to run a hacked version of yarn just to get the build output to understand what was going on.

@koresar

This comment has been minimized.

Copy link

@koresar koresar commented Mar 17, 2017

I find dtrace-provider poorly following SemVer. Every version of it is actually a breaking change. But they keep iterating over 0.*, for which SemVer is saying:

Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.

And there are like hundreds (or thousands) modules depending on "initial development" dtrace-provider package. Sadly.

@mrpsweet

This comment has been minimized.

Copy link

@mrpsweet mrpsweet commented Mar 26, 2017

Maybe you can do this~ @chenyaoli19
$ npm install hexo --no-optional
if it doesn't work
try
$ npm uninstall hexo-cli -g
$ npm install hexo-cli -g

@xibuka

This comment has been minimized.

Copy link

@xibuka xibuka commented Apr 20, 2017

I resolve this issue by run following command, remove dtrace-provider and re-install hexo-cli with sudo

$ sudo npm uninstall hexo-cli -g
$ sudo npm uninstall dtrace-provider -g
$ sudo npm install hexo-cli -g --no-optional
@vvo

This comment has been minimized.

Copy link

@vvo vvo commented May 15, 2017

It happened to me right now and I believe it happens when you do this:

˜/clean-project
yarn
node index.js # no problem
yarn cache clean
node index.js # shows errors from this issue

Maybe because those dtrace provider modules where cached and shared somehow.

@dunnock

This comment has been minimized.

Copy link

@dunnock dunnock commented May 15, 2017

This seems related to another issue with tap-consumer #886 , because when I manually run yarn install from dtrace-provider it fails with error

max$ yarn install
yarn install v0.24.3
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
error Couldn't find a package.json file in "/src/dtrace-provider/node_modules/tap/node_modules/tap-consumer"
@xuanvan229

This comment has been minimized.

Copy link

@xuanvan229 xuanvan229 commented May 20, 2017

@xibuka thanks. it work for me

@bestander bestander removed the needs triage label May 23, 2017
@kaizvn

This comment has been minimized.

Copy link

@kaizvn kaizvn commented Jul 13, 2017

For anyone got this error, I fixed it by install node-gyp globally.

yarn global add node-gyp
yarn 

The error 's gone. I guess it's the easiest way.

P.s: if you're installed node-gyp global already, try to remove it first.

@caseyduquettesc

This comment has been minimized.

Copy link

@caseyduquettesc caseyduquettesc commented Jul 15, 2017

I was using pyenv and had to run pyenv rehash and remove node_modules and then yarn install to fix the error in my case.

@rw3iss

This comment has been minimized.

Copy link

@rw3iss rw3iss commented Aug 3, 2017

Removing /node_modules (installed with npm) and installing via yarn solved this for me. Node v7.10.0 (v8.1.4 still threw errors even with yarn).

@Pajn

This comment has been minimized.

Copy link

@Pajn Pajn commented Aug 9, 2017

No matter which workaround in this issue I tried, it still failed so now I resort to a manual npm rebuild after using yarn.

@lecstor

This comment has been minimized.

Copy link

@lecstor lecstor commented Aug 15, 2017

this time I'm rid of the errors after

rm -rf node_modules
rm yarn.lock
yarn
@BYK

This comment has been minimized.

Copy link
Member

@BYK BYK commented Aug 15, 2017

Hey all,

I really need two things so we can address this issue:

  • Someone willing to provide exact, isolated reproduction steps. I read the whole thread and couldn't find a single comment stating the proper steps to reproduce this issue although I see a bunch of "me too"s. I'm not even sure if these are really the same issues :D
  • May be that same someone, trying the latest nightly to see if this is already fixed since there have been a lot of fixes since the reported versions of Yarn here.
@davidfirst

This comment has been minimized.

Copy link

@davidfirst davidfirst commented Aug 18, 2017

It seems to be fixed with the last version of dtrace-provider.

I updated my dtrace-provider from 0.8 to 0.8.5 and the error is gone.

@BYK

This comment has been minimized.

Copy link
Member

@BYK BYK commented Aug 19, 2017

Yay, thanks @davidfirst

@BYK BYK closed this Aug 19, 2017
@tony-kerz

This comment has been minimized.

Copy link

@tony-kerz tony-kerz commented Aug 26, 2017

@davidfirst i haven't had to manually do anything with dtrace-provider in the past.

are you saying you just did something like below?:

npm i -g dtrace-provider 
@davidfirst

This comment has been minimized.

Copy link

@davidfirst davidfirst commented Aug 28, 2017

@tony-kerz nope. It wasn't installed globally for me. It was a dependency of another package I'm using.
I just updated the lock file and it automatically chose the latest version of dtrace-provider, which is currently 0.8.5

@gsccheng

This comment has been minimized.

Copy link

@gsccheng gsccheng commented Aug 29, 2017

I fixed this by removing my yarn.lock file and having yarn reinstall all my modules from package.json.

@Gautam17

This comment has been minimized.

Copy link

@Gautam17 Gautam17 commented Oct 2, 2017

same issue with
yarn@1.0.0
Node@8.4.0
Npm@5.3.0
Sails.js@0.12
Mac@10.12.5

{ Error: Cannot find module './build/Release/DTraceProviderBindings'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
...
at Module._compile (module.js:573:30) code: 'MODULE_NOT_FOUND' }

@jjjacksn

This comment has been minimized.

Copy link

@jjjacksn jjjacksn commented Oct 5, 2017

I suspect many people may have slightly different issues which all surface as the same thing.

In my case, the solution was to make sure I was using Python 2.7 (and not Python 3). Hope that helps someone!

@davidjb

This comment has been minimized.

Copy link

@davidjb davidjb commented Oct 16, 2017

@xdissent Thanks for your thorough breakdown of the problem. In order to get the errors resolved, I had to ensure that dtrace-provider@0.8.5 had node-gyp available before being installed as a (optional) dependency by running:

yarn global add node-gyp
rm -rf node_modules yarn.lock
yarn install

dtrace-provider then successfully builds its native code, meaning the modules are actually available which ensures the require() call doesn't fail, and so on.

Ideally, this "failure" to build would be more obvious and yarn would report this. I see that other issues related to this problem mention yarn's --verbose mode as a solution, but the sheer amount of information outputted means any errors will just be lost in the noise.

@LeeJim

This comment has been minimized.

Copy link

@LeeJim LeeJim commented Dec 14, 2017

I have a not very good idea.
use v6.x.x Node.js can solve this problem.
and, use the nvm control the Node.js version. Like this:

npm install nvm -g
nvm install 6.12.0
nvm use 6.12.0
@addozhang

This comment has been minimized.

Copy link

@addozhang addozhang commented Dec 25, 2017

It's work for me.

rm -rf node_modules
npm intall 
@aawalker238

This comment has been minimized.

Copy link

@aawalker238 aawalker238 commented Apr 23, 2018

I had this same issue and just ran npm rebuild dtrace-provider and it fixed everything.

@andrea-f

This comment has been minimized.

Copy link

@andrea-f andrea-f commented Nov 27, 2018

Still seeing the error, got rid of it by:

rm -rf node_modules and npm install --no-optional

@douglasricc7

This comment has been minimized.

Copy link

@douglasricc7 douglasricc7 commented Oct 9, 2019

andrea-f your solution worked for me. Thanks

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

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.