sintaxi / harp

Static Web Server/Generator/Bundler
http://harpjs.com
5k stars 346 forks source link

compile hangs and silently fails when harp is installed in local project #624

Closed robjtede closed 5 years ago

robjtede commented 6 years ago

Steps for reproduction:

mkdir proj
cd proj
harp init
npm install --save harp
harp compile OR npx harp compile

This effect can also be seen when using an npm script to compile instead of npx.

sintaxi commented 6 years ago

I appreciate you taking the time to open a ticket though not much useful information being provided here to help get this fixed. Steps to reproduce? Version of harp? OS? Anything info you provide will help the likelihood and speed this issue can get resolved. Thanks.

robjtede commented 6 years ago

@sintaxi yeah my bad, I hit submit before entering the steps

sintaxi commented 6 years ago

Awesome. Thank you.

robjtede commented 6 years ago

I also made a mess of the steps. Fixed now.

robjtede commented 6 years ago

This is motivated by not wanting to have to install harp globally.

robjtede commented 6 years ago

I've had to use the --unsafe-perms flag on npm install to install harp globally on my production server. (Due to dependence on node-sass.) I'd really love to see this package runnable in a local environment.

mzgajner commented 6 years ago

@robjtede the issue here is actually the fact just running harp compile tries to go through all the files in your project folder and compile them. That includes node_modules, which is huge and the process hangs.

You can track #275 and #312 to see if there will be a feature added to easily ignore this folder. Until then, there's a relatively simple workaround - move all your project files (except package.json and others unrelated to harp) to a folder (e.g. source) and call harp compile source target.

This allowed me to install harp locally without any issues - the only change is that I now call it using node_modules/.bin/harp <whatever>.