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 'perf_hooks' from nanotiming #19

Closed
kristoferjoseph opened this issue Feb 16, 2018 · 5 comments
Closed

Cannot find module 'perf_hooks' from nanotiming #19

kristoferjoseph opened this issue Feb 16, 2018 · 5 comments

Comments

@kristoferjoseph
Copy link

kristoferjoseph commented Feb 16, 2018

I am running a standalone browserify build that is not completing because of this error.
Error: Cannot find module 'perf_hooks' from '.../node_modules/nanotiming'
https://github.com/choojs/nanotiming/blob/master/index.js#L6

@kristoferjoseph
Copy link
Author

I upgraded to the latest node version 8.9.4 and the error changed to something like
Error: lstat perf_hooks is not a file or directory

if i create a file named 'perf_hooks' at the path listed in the error it works as expected :/

@kristoferjoseph
Copy link
Author

kristoferjoseph commented Mar 6, 2018

Looks like wrapping the require('perf_hooks') in a try catch isn't enough.
Error causes browserify standalone build to fail
Error: Cannot find module 'perf_hooks' from '.../node_modules/nanotiming'

@yoshuawuyts
Copy link
Member

Tested this on node 6, 8 and 9 today, and it seems the try...catch should be enough. Is this perhaps related to a bundler you're running on your end perhaps?

@goto-bus-stop
Copy link
Member

browserify/browserify#1815 should fix I think?

@xiaoanne
Copy link

I got this fixed by upgrade node version to 8.11.2:

nvm install v8.11.2

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

No branches or pull requests

4 participants