Node-sass: `npm i` success; `yarn install` fail

Created on 25 Feb 2018  ยท  6Comments  ยท  Source: sass/node-sass

CLOSE - Issue template ignored

Most helpful comment

Hey @iTonyYo - there's an issue template on this repository. It'd be great if you could follow that template and provide the information it asks for.

Also, instead of a screenshot, could you just paste the text instead? That'll make it easier to work with.

All 6 comments

Hey @iTonyYo - there's an issue template on this repository. It'd be great if you could follow that template and provide the information it asks for.

Also, instead of a screenshot, could you just paste the text instead? That'll make it easier to work with.

Definitely, thanks for pointing that out @deoxxa. Also please answer my question from the other bug:

Did you compile node yourself? Can you check config.gypi file in the build directory?

I'm having pretty much the same issue lately:

error An unexpected error occurred: "/home/project/cp/node_modules/node-sass: Command failed.
Exit code: 1
Command: sh
Arguments: -c node scripts/build.js
Directory: /home/project/cp/node_modules/node-sass
Output:
Building: /usr/bin/node /home/project/cp/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   '/home/project/cp/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 [email protected]
gyp info using [email protected] | 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.12\
\"
gyp verb get node dir no --target version specified, falling back to host node version: 8.9.4
gyp verb command install [ '8.9.4' ]
gyp verb install input version string \"8.9.4\"
gyp verb install installing version: 8.9.4
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.9.4
gyp verb build dir attempting to create \"build\" dir: /home/project/cp/node_modules/node-sass/build
gyp verb build dir \"build\" dir needed to be created? /home/project/cp/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: /home/project/cp/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file: /home/project/cp/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file: /home/project/cp/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 [ '/home/project/cp/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   '/home/project/cp/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/project/cp/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/me/.node-gyp/8.9.4/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/me/.node-gyp/8.9.4',
gyp info spawn args   '-Dnode_gyp_dir=/home/project/cp/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/me/.node-gyp/8.9.4/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/project/cp/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/me/.node-gyp/8.9.4
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/project/cp/node_modules/node-sass/build'
  g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION=\"3.3.6\"' -I/home/me/.node-gyp/8.9.4/include/node -I/home/me/.node-gyp/8.9.4/src -I/home/me/.node-gyp/8.9.4/deps/uv/include -I/home/me/.node-gyp/8.9.4/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++0x -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
make: g++: Command not found
make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Error 127
src/libsass.target.mk:139: recipe for target 'Release/obj.target/libsass/src/libsass/src/ast.o' failed
make: Leaving directory '/home/project/cp/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 (/home/project/cp/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.10.0-35-generic
gyp ERR! command \"/usr/bin/node\" \"/home/project/cp/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\" \"--verbose\" \"--libsass_ext=\" \"--libsass_cflags=\" \"--libsass_ldflags=\" \"--libsass_library=\"
gyp ERR! cwd /home/project/cp/node_modules/node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
  • Node: 8.9.4
  • Yarn: 1.5.1

  • node -p process.versions
    { http_parser: '2.7.0',
    node: '8.9.4',
    v8: '6.1.534.50',
    uv: '1.15.0',
    zlib: '1.2.11',
    ares: '1.10.1-DEV',
    modules: '57',
    nghttp2: '1.25.0',
    openssl: '1.0.2n',
    icu: '59.1',
    unicode: '9.0',
    cldr: '31.0.1',
    tz: '2017b' }

  • linux x64

  • node -p "require('node-sass').info"
    node-sass 4.7.2 (Wrapper) [JavaScript]
    libsass 3.5.0.beta.2 (Sass Compiler) [C/C++]

  • npm ls node-sass
    /home/project/cp
    pm ls node-sass

Except npm install also fails:

โฑ npm install
npm WARN deprecated [email protected]: Check out CommitLint which provides the same functionality with a more user-focused experience.
npm WARN deprecated [email protected]: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

> [email protected] install/home/project/cp/node_modules/uws
> node-gyp rebuild > build_log.txt 2>&1 || exit 0


> [email protected] install/home/project/cp/node_modules/sasslint-webpack-plugin/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

> [email protected] install/home/project/cp/node_modules/husky
> node ./bin/install.js

husky
setting up Git hooks
done


> [email protected] install/home/project/cp/node_modules/node-sass
> node scripts/install.js

Cached binary found at /home/me/.npm/node-sass/4.7.2/linux-x64-57_binding.node

> [email protected] postinstall/home/project/cp/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> [email protected] postinstall/home/project/cp/node_modules/sasslint-webpack-plugin/node_modules/node-sass
> node scripts/build.js

Building: /usr/bin/node/home/project/cp/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   '/home/me/projects/frontend-control-panel/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 [email protected]
gyp info using [email protected] | 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.12\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.9.4
gyp verb command install [ '8.9.4' ]
gyp verb install input version string "8.9.4"
gyp verb install installing version: 8.9.4
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.9.4
gyp verb build dir attempting to create "build" dir:/home/project/cp/node_modules/sasslint-webpack-plugin/node_modules/node-sass/build
gyp verb build dir "build" dir needed to be created?/home/project/cp/node_modules/sasslint-webpack-plugin/node_modules/node-sass/build
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file:/home/project/cp/node_modules/sasslint-webpack-plugin/node_modules/node-sass/build/config.gypi
gyp verb config.gypi checking for gypi file:/home/project/cp/node_modules/sasslint-webpack-plugin/node_modules/node-sass/config.gypi
gyp verb common.gypi checking for gypi file:/home/project/cp/node_modules/sasslint-webpack-plugin/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 [ '/home/me/projects/frontend-control-panel/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   '/home/me/projects/frontend-control-panel/node_modules/sasslint-webpack-plugin/node_modules/node-sass/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/me/projects/frontend-control-panel/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/me/.node-gyp/8.9.4/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/me/.node-gyp/8.9.4',
gyp info spawn args   '-Dnode_gyp_dir=/home/me/projects/frontend-control-panel/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/me/.node-gyp/8.9.4/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/me/projects/frontend-control-panel/node_modules/sasslint-webpack-plugin/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/me/.node-gyp/8.9.4
gyp verb `which` succeeded for `make` /usr/bin/make
gyp info spawn make
gyp info spawn args [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/me/projects/frontend-control-panel/node_modules/sasslint-webpack-plugin/node_modules/node-sass/build'
  g++ '-DNODE_GYP_MODULE_NAME=libsass' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DLIBSASS_VERSION="3.3.6"' -I/home/me/.node-gyp/8.9.4/include/node -I/home/me/.node-gyp/8.9.4/src -I/home/me/.node-gyp/8.9.4/deps/uv/include -I/home/me/.node-gyp/8.9.4/deps/v8/include -I../src/libsass/include  -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -O3 -fno-omit-frame-pointer -std=gnu++0x -std=c++0x -fexceptions -frtti -MMD -MF ./Release/.deps/Release/obj.target/libsass/src/libsass/src/ast.o.d.raw   -c -o Release/obj.target/libsass/src/libsass/src/ast.o ../src/libsass/src/ast.cpp
make: g++: Command not found
src/libsass.target.mk:139: recipe for target 'Release/obj.target/libsass/src/libsass/src/ast.o' failed
make: *** [Release/obj.target/libsass/src/libsass/src/ast.o] Error 127
make: Leaving directory '/home/me/projects/frontend-control-panel/node_modules/sasslint-webpack-plugin/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 (/home/me/projects/frontend-control-panel/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.10.0-35-generic
gyp ERR! command "/usr/bin/node" "/home/me/projects/frontend-control-panel/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd/home/project/cp/node_modules/sasslint-webpack-plugin/node_modules/node-sass
gyp ERR! node -v v8.9.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
Build failed with error code: 1
npm WARN @angular/[email protected] requires a peer of typescript@>=2.4.2 <2.7 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/animations@^4.2.5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^4.2.5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/compiler@^4.2.5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^4.2.5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/forms@^4.2.5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/http@^4.2.5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^4.2.5 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^2.4.7 || ^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @ngrx/store@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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/me/.npm/_logs/2018-03-05T16_04_19_279Z-debug.log

Maybe something is wrong with my make?

make -v
GNU Make 4.1
Built for x86_64-pc-linux-gnu

Looks like sasslint-webpack-plugin was the culprit, removing it fixed the issue.

@mxchange you're trying to install 3.13.1 (or one of your dependecies is) on Node 8, which isn't supported. Please open a new issue next time and follow the issue instrutions, since this has been reported a bunch of times.

Closing and locking since there has been no response from the original poster

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nagyfej picture nagyfej  ยท  3Comments

liuyuqiang picture liuyuqiang  ยท  3Comments

bgolubovic picture bgolubovic  ยท  3Comments

amarbham picture amarbham  ยท  3Comments

harukaeru picture harukaeru  ยท  3Comments