sintaxi / harp

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

Cannot install or use on macOS High Sierra #632

Closed pvaibhav closed 5 years ago

pvaibhav commented 6 years ago

On macOS 10.13.4 with latest xcode. Followed instructions:

brew install node
npm install -g harp

First fails because python2 is not installed. Can be fixed by brew install python2

Then it fails during some C++ compilation:

In file included from ../src/binding.cpp:3:
../src/sass_context_wrapper.h:8:10: fatal error: 'sass/context.h' file not found
#include <sass/context.h>
         ^~~~~~~~~~~~~~~~

Problems: libsass and python2 not listed as a dependency.

After doing brew install libsass, harp can be compiled and installed, but doesn't work:

~/Work/harp                                                                           
▶ harp
dyld: lazy symbol binding failed: Symbol not found: _sass_make_boolean
  Referenced from: /usr/local/lib/node_modules/harp/node_modules/node-sass/vendor/darwin-x64-64/binding.node
  Expected in: flat namespace

dyld: Symbol not found: _sass_make_boolean
  Referenced from: /usr/local/lib/node_modules/harp/node_modules/node-sass/vendor/darwin-x64-64/binding.node
  Expected in: flat namespace

[1]    78997 abort      harp

How do I make this work? Thanks.

pvaibhav commented 6 years ago

I tried on two separate FreeBSD 11 servers, and cannot install it either:

gyp verb command install [ '9.10.1' ]
gyp verb install input version string "9.10.1"
gyp verb install installing version: 9.10.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 9.10.1
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/harp/node_modules/node-sass/.node-gyp/9.10.1
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/harp/node_modules/node-sass/.node-gyp/9.10.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/harp/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '9.10.1' ]
gyp verb install input version string "9.10.1"
gyp verb install installing version: 9.10.1

which keeps repeated over and over.

Note that I am running as root!

pvaibhav commented 6 years ago

The reason is that node-sass version must be at least v4.9.0 to work with node 10.1.0. It is currently specified as 4.7.2 (probably by the "terraform" package).

Please update your dependencies. This was too much unnecessary work learning how nodejs and npm works, before I managed to make a temporary fix by editing the package-lock.json file manually. Specially when the first sentence of the quick start guide says

First, install Node.js. Harp uses Node.js, but you don’t need to know about Node.js or even JavaScript to use Harp.

ad-si commented 6 years ago

I'm getting this error:

Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime (57)

Probably has the same root cause

sintaxi commented 6 years ago

@ad-si I just released v.0.26.0 about an hour ago. Is that what you we're installing?

ad-si commented 6 years ago

@sintaxi Yes it is

sintaxi commented 6 years ago

@ad-si Are you able to install npm install harp@0.25.0? Also what version of surge are you using?

ad-si commented 6 years ago

Yeah, that's what I did. I downgraded to harp@0.25.0 and then it worked. (Btw: I'm still using node v8.11.1)

misterhtmlcss commented 5 years ago

This conversation looks like the issue has been resolved, so I'm going to close it. Thank you for choosing Harp @ad-si and let us know if you have further issues in the future.

kenjura commented 5 years ago

Same issue, using High Sierra 10.13.6, node 11.0.0. I tried current version of Harp, then tried @ad-si's approach and installed 0.25.0. It didn't help.

misterhtmlcss commented 5 years ago

hi @kenjura currently we support only the LTS versions of node. We are aware that Node 10 recently went LTS, but we aren't there yet. The best short-term advice I could give you are to go the NVM route; it's what I use as I develop on multiple versions of NodeJS. Do you know NVM? In case you don't and are looking for more help; check these out:

Let me know if this is something you are willing to pursue. I personally resisted it for a long time, but found that NVM was really something that made life easier and wasn't actually much of a time or intellectual investment.

Looking forward to hearing how it goes Ken.

kenjura commented 5 years ago

Okay, that makes sense. I suppose it's reasonable, given that it's still version 0, and 11 is kind of bleeding edge. I switched to 8.12 and it seems to be working fine. Thanks!