Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-sass fails to build when using an offline mirror #2097

Closed
Jehops opened this issue Sep 14, 2017 · 2 comments
Closed

node-sass fails to build when using an offline mirror #2097

Jehops opened this issue Sep 14, 2017 · 2 comments

Comments

@Jehops
Copy link

Jehops commented Sep 14, 2017

yarn --offline fails to build node-sass.

This is using yarn 1.0.2, building node-sass-4.5.3 on FreeBSD using node 8.5.0 and an offline mirror. The issue is mentioned in issue #1911, and while FreeBSD binaries are now available (thanks @saper), building is still a problem, because specifying the location of the node headers does not work and downloading the headers is not possible when offline. The cause of the problem, in a nutshell, is that the system installation of libuv cannot be found. The header file uv.h is located in /usr/local/include by default.

Adding the equivalent to npm's --nodedir with yarn --offline config set nodedir /usr/local causes this error.

  c++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/usr/local/include/node -I/usr/local/src -I/usr/local/deps/uv/include -I/usr/local/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -std=c++0x -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:1:
../../nan/nan.h:48:10: fatal error: 'uv.h' file not found
#include <uv.h>
         ^~~~~~

Using yarn --offline config set nodedir /usr/local/include/node causes this error.

  c++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/usr/local/include/node/include/node -I/usr/local/include/node/src -I/usr/local/include/node/deps/uv/include -I/usr/local/include/node/deps/v8/include -I../../nan -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++0x -std=c++0x -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:1:
../../nan/nan.h:24:10: fatal error: 'node_version.h' file not found
#include <node_version.h>
         ^~~~~~~~~~~~~~~~

I have also tried downloading the node headers tarball and placing it in various locations, including .node-gyp/8.5.0, but the http GET is still attempted during yarn install --offline.

  • NPM version:
    Using yarn version 1.0.2

  • Node version:
    v8.5.0

  • Node Process:

{ http_parser: '2.7.0',
  node: '8.4.0',
  v8: '6.0.286.52',
  uv: '1.14.1',
  zlib: '1.2.11',
  ares: '1.12.0',
  modules: '57',
  nghttp2: '1.22.0',
  openssl: '1.0.2l',
  icu: '59.1',
  unicode: '9.0',
  cldr: '31.0.1',
  tz: '2017b' }
  • Node Platform
    FreeBSD

  • Node architecture (node -p process.arch):
    x64

  • node-sass version
    4.5.3

@saper
Copy link
Member

saper commented Sep 14, 2017

Can you check if nodejs/node-gyp#1264 along with an optional but recommended #2070 fix this?

@Jehops
Copy link
Author

Jehops commented Sep 14, 2017

I just tested nodejs/node-gyp#1264 and the builds finishes successfully. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants