sass / node-sass

:rainbow: Node.js bindings to libsass
https://npmjs.org/package/node-sass
MIT License
8.5k stars 1.33k forks source link

Issue Installing Node-Sass - ELIFECYCLE #1932

Closed ronanfernandes closed 7 years ago

ronanfernandes commented 7 years ago

Trying to install a package that uses node-sass. No luck! Every time I try to run 'npm install' or 'sudo npm install' in the app folder (where package.json is located) it breaks whenever it tries to install node-sass:

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! node-sass@3.13.1 install: node scripts/install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@3.13.1 install script 'node scripts/install.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the node-sass package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node scripts/install.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs node-sass npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls node-sass npm ERR! There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2017-03-26T09_46_56_175Z-debug.log

Tried to install node-sass globally using: 'sudo npm install node-sass' and got the same error ELIFECYCLE. BUT, when i tried 'sudo PATH="$PATH:/usr/bin" npm install node-sass, IT WORKED. I could install node-sass globally.

Then I thought it was a PATH issue and tried 'sudo PATH="$PATH:/usr/bin" npm install node-sass' (or just npm install, to try to install the whole package). No luck!

Always receiving this "ELIFECYCLE" error. I´m new to Linux, used to develop in Windows + Xampp.

nschonni commented 7 years ago

Can you provide the full log in a Gist?

noraj commented 7 years ago

v3.13.1/linux-x64-57 doesn't exist, it exist until v3.13.1/linux-x64-51

npm install node-sass@3.13.1                                                                                                                                                    noraj@manji

> node-sass@3.13.1 install /tmp/Rawsec/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v3.13.1/linux-x64-57_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v3.13.1/linux-x64-57_binding.node": 

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g. 

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

> node-sass@4.5.3 install /tmp/Rawsec/node_modules/hexo-renderer-sass/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/noraj/.npm/node-sass/4.5.3/linux-x64-57_binding.node

> node-sass@3.13.1 postinstall /tmp/Rawsec/node_modules/node-sass
> node scripts/build.js

Building: /usr/bin/node /tmp/Rawsec/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/bin/node',
gyp verb cli   '/tmp/Rawsec/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@8.1.2 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.13\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.1.2
gyp verb command install [ '8.1.2' ]
gyp verb install input version string "8.1.2"
gyp verb install installing version: 8.1.2
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 9
gyp verb needs "installVersion" 9
gyp verb install version is good
gyp verb get node dir target node version installed: 8.1.2
gyp verb build dir attempting to create "build" dir: /tmp/Rawsec/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created? /tmp/Rawsec/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /tmp/Rawsec/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /tmp/Rawsec/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /tmp/Rawsec/node_modules/node-sass/common.gypi
gyp verb gyp gyp format was not specified; forcing "make"
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/tmp/Rawsec/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/tmp/Rawsec/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/tmp/Rawsec/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/noraj/.node-gyp/8.1.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/noraj/.node-gyp/8.1.2',
gyp info spawn args   '-Dnode_gyp_dir=/tmp/Rawsec/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/noraj/.node-gyp/8.1.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/tmp/Rawsec/node_modules/node-sass',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir /home/noraj/.node-gyp/8.1.2
gyp verb `which` succeeded for `make` /usr/bin/make
make: Entering directory '/tmp/Rawsec/node_modules/node-sass/build'
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
  g++ '-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/home/noraj/.node-gyp/8.1.2/include/node -I/home/noraj/.node-gyp/8.1.2/src -I/home/noraj/.node-gyp/8.1.2/deps/uv/include -I/home/noraj/.node-gyp/8.1.2/deps/v8/include -I../../nan  -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:3:0:
../src/sass_context_wrapper.h:8:10: fatal error: sass/context.h: No such file or directory
 #include <sass/context.h>
          ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [binding.target.mk:110: Release/obj.target/binding/src/binding.o] Error 1
make: Leaving directory '/tmp/Rawsec/node_modules/node-sass/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/tmp/Rawsec/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
gyp ERR! System Linux 4.9.33-1-MANJARO
gyp ERR! command "/usr/bin/node" "/tmp/Rawsec/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /tmp/Rawsec/node_modules/node-sass
gyp ERR! node -v v8.1.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@3.13.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@3.13.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/noraj/.npm/_logs/2017-06-25T18_24_14_741Z-debug.log
noraj commented 7 years ago

Full log https://gist.github.com/anonymous/066ea44c7764587be0159af6fac9c0e6

nschonni commented 7 years ago

@noraj1337 3.13.1 is old and doesn't support Node 8. It also used a submodule for the libsass files, which appears not to have been initialized if it can't find the header.

Closing since the original poster never responded

noraj commented 7 years ago

I know it's old but https://github.com/knksmith57/hexo-renderer-sass was using it. And yes I was using Node 8.

xzyfer commented 7 years ago

There's nothing we can do. You can either ask them to update their node-sass dependency to 4.5+ or down grade your node.

On 27 Jun. 2017 7:15 am, "Alexandre ZANNI" notifications@github.com wrote:

I know it's old but https://github.com/knksmith57/hexo-renderer-sass was using it. And yes I was using Node 8.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sass/node-sass/issues/1932#issuecomment-311184015, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjZWCU0V5zLOMdInJkuKpVoEYoxcs2cks5sIB9cgaJpZM4MpoTo .

mstrzoda commented 7 years ago

I had similar problem. I switched to new machine and i expected that i just retrieve whole code from git, then just npm install and npm run build, but it stuck on getting node-sass 3.13.1. It still worked on my second computer, because this module was downloaded long time ago. The question is if this release: https://github.com/sass/node-sass/releases/download/v3.13.1/win32-ia32-57_binding.node existed half year ago and then you removed it. If yes, then people cannot trust this source anymore - suddenly your application does not build because brand new build machine didnt have your modules cached.

nschonni commented 7 years ago

@mstrzoda there was never a binary provide for Node 8 for 3.13.1

mstrzoda commented 7 years ago

@nschonni a ok, so i had node 8, and npm tried to download node-sass 3.13.1 for node 8, which never existed, and on my old computer and on server we had older node, that's why it worked there. Complicated like Lost plot, but makes sense. Thank you!

thesourav123 commented 6 years ago

@nschonni How to force npm to use node-sass 4.6.1 for node 8 and npm 5.5.1 instead of 3.13.1