Closed chiubaka closed 2 years ago
Very odd error. Noticing this on lib.node
and app.react
.
Inside the actual prettier
bin there's this:
var pleaseUpgradeNode = require_please_upgrade_node();
var packageJson = require("./package.json");
pleaseUpgradeNode(packageJson);
var cli = require("./cli.js");
module.exports = cli.run(process.argv.slice(2));
The problem seems to be with the require("./package.json")
line here. Printing cwd
shows the right directory, though... so this is a bit weird.
require("./package.json")
in a simple testnode
script does work, though 🤔. Removing changes to package.json
from the stage doesn't solve the problem. Nor does throwing away changes to package.json
.
I think to solve this I'm going to need to do some kind of bisect, unfortunately.
Hm. Providing an absolute path to a package.json
file results in a working require
. So something about the relative pathing and the current working directory for resolution??
I attempted to upgrade Prettier in case that changes anything. It didn't.
Coming back to this after the long weekend and, oddly, this isn't happening on a fresh workspace with generated React app anymore.
Best I can come up with is that a restart of my computer has somehow changed something? That or I'm being very sure to use the local registry this time by using npm_config_registry=http://localhost:4873 npx genesis
.
Either way... seems like this is fixed??