sintaxi / harp

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

Harp broken in Node 5/npm 3 #510

Closed omichelsen closed 8 years ago

omichelsen commented 8 years ago

My harp installation stopped working after upgrade to Node 5 with the following message:

Error: The `libsass` binding was not found in /usr/local/lib/node_modules/harp/node_modules/terraform/node_modules/node-sass/vendor/darwin-x64-47/binding.node
This usually happens because your node version has changed.
Run `npm rebuild node-sass` to build the binding for your current node version.

The rebuild command did nothing, so I tried reinstalling Harp, which led to this epic fail:

gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  c++ '-DNODE_GYP_MODULE_NAME=binding' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/Users/olem/.node-gyp/5.0.0/include/node -I/Users/olem/.node-gyp/5.0.0/src -I/Users/olem/.node-gyp/5.0.0/deps/uv/include -I/Users/olem/.node-gyp/5.0.0/deps/v8/include -I../../nan  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++0x -fno-rtti -fno-exceptions -fno-threadsafe-statics -std=c++11 -MMD -MF ./Release/.deps/Release/obj.target/binding/src/binding.o.d.raw  -c -o Release/obj.target/binding/src/binding.o ../src/binding.cpp
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>
         ^
1 error generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/harp/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/lib/node_modules/harp/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/harp/node_modules/node-sass
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Build failed
npm WARN install:node-sass@3.3.3 node-sass@3.3.3 postinstall: `node scripts/build.js`
npm WARN install:node-sass@3.3.3 Exit status 1

No variation of sudo or simliar will make it work. It's obviously caused by something in node-sass (again), but do you have any insights into an upcoming fix?

ir-g commented 8 years ago

@omichelsen The problem appears to be from those logs specifically caused by the NPM package node-sass. I have had similar issues, when trying to harp or harp-dependent applications, including on windows(alexgleason/harp-gui#22).

Some support may be available at github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md, though if you continue to have these errors, try seeing if node-sass on its own will work.

If node-sass wont work when you try installing and running it, then you may well wish to raise an issue here.

omichelsen commented 8 years ago

Thanks for the suggestions, but npm install -g node-sass works fine. It's only when installing Harp things go awry.

ir-g commented 8 years ago

@sintaxi may well need a look at this, then

james89 commented 8 years ago

@isaacrg Experiencing @omichelsen's error as well! Thanks

james89 commented 8 years ago

@omichelsen If you're using homebrew, switching global node version back to v4.2.2 allowed me to install harp correctly

silentrob commented 8 years ago

Harp support is tied pretty closly with node-sass. I suspect when node-sass works on npm 3/node 5 harp will get bumped too. For the time being go back to node 4 and re-install. Hopefully you are using nvm and that is an easy task.

robclancy commented 8 years ago

@silentrob Considering node-sass installs just fine I don't see how it can be the issue.

ir-g commented 8 years ago

Harp might not be using the latest node-sass version, which could be the difference.

On Fri, 6 Nov 2015 00:11 Robert Clancy (Robbo) notifications@github.com wrote:

@silentrob https://github.com/silentrob Considering node-sass installs just fine I don't see how it can be the issue.

— Reply to this email directly or view it on GitHub https://github.com/sintaxi/harp/issues/510#issuecomment-154240087.

ir-g commented 8 years ago

I can confirm that heroku is running Node V5.0.0, and when I tried loading an app dependent on the latest version of harp on (0.19.0), node-sass wouldn't install. Log at: http://pastebin.com/hDByf4yQ

kennethormandy commented 8 years ago

This will be fixed in the next release of Harp. If you need to get around it in the meantime, I’ve updated Terraform, Harp’s preprocessing engine, with the latest release of Node-sass. So, you can install that manually in the meantime if you’d like. In your project directory, you can run:

npm install --save-dev harp terraform@0.13.1

Or use npm shinkwrap and set your own versions. We’ll have a new release out soon with this updated properly, though. Thanks for your patience! #502

ir-g commented 8 years ago

Thanks!

On Fri, 6 Nov 2015 23:03 Kenneth Ormandy notifications@github.com wrote:

This will be fixed in the next release of Harp. If you need to get around it in the meantime, I’ve updated Terraform, Harp’s preprocessing engine, with the latest release of Node-sass. So, you can install that manually in the meantime if you’d like. In your project directory, you can run:

npm install --save-dev harp terraform@0.13.1

Or use npm shinkwrap https://docs.npmjs.com/cli/shrinkwrap and set your own versions. We’ll have a new release out soon with this updated properly, though. Thanks for your patience! #502 https://github.com/sintaxi/harp/pull/502

— Reply to this email directly or view it on GitHub https://github.com/sintaxi/harp/issues/510#issuecomment-154570463.

IngwiePhoenix commented 8 years ago

Yup, broken here too. C++ errors arise during the build, reflecting the major native API changes, most of them being breaking ones.

Harp should be updated to reflect these changes too, imho. :)

saper commented 8 years ago

@fustkilas Try ./node_modules/.bin/harp

ghost commented 8 years ago

I ended up using https://github.com/tj/n and node 4.0.0, awaiting latest harp.

aviris commented 8 years ago

Deleted all node and npm traces from my system, reinstalled Node/npm 6.5.0/3.10.3 with Homebrew, then npm install -g harp@next

Works perfectly!

adeonir commented 7 years ago

Here I did not have to uninstall node/npm, only installed using harp@next