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.

Hoodie install breaks on my (admittedly unusual) setup

See original GitHub issue

I’ve been doing my development on Virtual Machines using Vagrant, and I use a symbolic link on the node_modules directory to prevent it from being synced with my host machine. This causes the hoodie install to fail.

Steps to reproduce:

mkdir proxy
mkdir proxy/node_modules
mkdir app
cd app
ln -nsf ../proxy/node_modules node_modules
npm init -y
npm i -S hoodie

The issue is that setup.js uses path.resolve('..', '..') to find the App Root, but that leads to the proxy directory and not the app directory where my package.json lives. I have a workaround, so it’s not a high priority issue for me. One solution that works for my scenario is to use path.resolve(process.env.PWD, '..', '..') instead to find the App Root, but I’m not sure if that would break under other setups. In any case, I think the script should fail gracefully if it can’t find the package.json where it’s expecting. As it is, it’s reverting the entire installation after throwing an exception. It should probably just emit a friendly message: “Hey, couldn’t find your package.json to add the start script.” and exit without reverting the installation.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
parallaxeffectcommented, Jun 5, 2017

Yeah, my current work-around is to add a symlink in /proxy where npm thinks package.json should be and linking it to my actual package.json in /app. It seems to be working just fine. I just wanted to make sure you were aware of the issue in case it comes up in some other context or so if someone else comes to you with a similar problem you’ll know what’s wrong and be able to help them with it. I agree with the idea of getting rid of the postinstall script in the future.

1reaction
parallaxeffectcommented, May 30, 2017

process.cwd() doesn’t work. It returns the cwd’s “true path”: /proxy/node_modules/hoodie, whereas process.env.PWD is set by the shell on start-up and returns the path that the shell currently believes is the cwd: /app/node_modules/hoodie.

I’ll try to work on the fail gracefully for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

the new hire who showed up is not the same person we ...
– Husband describes John as being aloof and pretty timid whereas John was confident and articulate when they interviewed him. He is convinced ......
Read more >
Harbaugh is my hero shirt - T-shirt AT Fashion LLC
This Harbaugh is my hero shirt, hoodie, sweater, tank top, long sleeve, ... effect during photo shooting or possibly different monitor display settings....
Read more >
how to upgrade metal characters in injustice
To upgrade the Special Attacks of each of the Metal characters, you have to gain Valorium Alloy. Retro Series Clue 1986 Edition…. star...
Read more >
funny blogs to read - Paddle Tennis Roma
Viraj Dalvi November 24, 2022 We produce humor-infused blogs and articles that make you think. Sneezy The Clown. Baby Rabies. Bazillion is a...
Read more >
Pregnant Daisy Lowe displays her blossoming baby bump in ...
Daisy showed off her families Christmas set-up including a beautifully set table and their meal. It comes after Daisy candidly discussed the ......
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