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

Issue with /lib/pkginfo.js for finding package.json #27

Open
owenashurst opened this issue Dec 10, 2018 · 1 comment
Open

Issue with /lib/pkginfo.js for finding package.json #27

owenashurst opened this issue Dec 10, 2018 · 1 comment

Comments

@owenashurst
Copy link

I've experienced a rather serious issue in which when attempting to debug in visual studio code a solution that uses pkginfo, I would get an error for pkginfo that the package.json file cannot be found inside \lib/package.json.

I believe on line 104 of pkgingfo.js file in /lib is wrong and should actually be looking 2 directories back in the root folder.

e.g.

wrong line: contents = require(dir + '/package.json');
should be: contents = require(dir + '../../package.json');

@stvngrsh
Copy link

stvngrsh commented Feb 12, 2019

I'm having the same issue. Cannot debug a project using VSCode because one of my packages uses pkginfo as a subdependency. This may also be just an issue with VSCode or our debug config, because I've had this happen with another package, where the module importer looks in the lib/build folder for package.json.

I get the following error:

Exception has occurred: Error
Error: Cannot find module '[PROJECT PATH]/node_modules/pkginfo/lib/package.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Function.pkginfo.find ([PROJECT PATH]/node_modules/pkginfo/lib/pkginfo.js:104:16)
    at Function.pkginfo.read ([PROJECT PATH]/node_modules/pkginfo/lib/pkginfo.js:122:22)
    at module.exports ([PROJECT PATH]/node_modules/pkginfo/lib/pkginfo.js:68:21)
    at Object.<anonymous> ([PROJECT PATH]/node_modules/pkginfo/lib/pkginfo.js:129:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)

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

2 participants