question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't resolve '../package' in 'node_modules/pusher/lib'

See original GitHub issue

version.js is failing to resolve the version because ../package is not found. Changing this to:

module.exports = require('../package.json').version;

resolves the issue.

Node version: v6.1.0 Npm version: 3.8.6

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
mcblumcommented, May 16, 2018

@dmonay So interestingly enough, I was just getting back to this and tried something different, which happened to work. I couldn’t figure out why this worked perfectly before we introduced Webpack, but did not work afterward, so I looked at out Webpack config:

resolve: {
   extensions: ['.tsx', '.ts', '.js']
},

I don’t pretend to understand exactly how Webpack works, but adding .json to the above array fixed it. Maybe this will help someone else should they stumble upon this issue.

Thanks for the reply!

2reactions
jameshfishercommented, Jan 29, 2020

So it looks like maybe I broke this 3.5 years ago in this PR: https://github.com/pusher/pusher-http-node/pull/51

Wherein @topliceanu said “I don’t think you need the .json extension”, I agreed, but it seems we were probably wrong …

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Error: Can't resolve 'crypto' - Stack Overflow
I ran into a similar issue lately while trying to use another library (tiff.js) in a small project I was experimenting with.
Read more >
pusher-js - npm
Pusher Channels JavaScript library for browsers, React Native, NodeJS and web workers. Latest version: 8.0.0, last published: 10 days ago.
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >
use 'stats.errordetails: true' resp. '--stats-error-details' to ... - You.com
There is an open bug report for this on the pusher-js library. ... src/public/index.ts 35:17-38 Module not found: Error: Can't resolve './maybe.js' in...
Read more >
[Solution] Error: Cannot Find Module "nodemailer" - Courier
This error occurs when you have not installed the nodemailer library in your Node.js application. Solution - Here's How To Resolve It. First,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found