sass / node-sass

:rainbow: Node.js bindings to libsass

Home Page:https://npmjs.org/package/node-sass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Postinstall build issue while trying to install node sass

ksri1984 opened this issue · comments

Hi Team,

When we are trying to install node-sass@latest version in my local windows machine got command failed error.

Please help

npm@8.13.1
node@v16.15.

1281 timing build:link:node_modules/read-pkg/node_modules/semver Completed in 68ms
1282 timing build:link Completed in 70ms
1283 info run node-sass@7.0.1 install node_modules/node-sass node scripts/install.js
1284 info run node-sass@7.0.1 install { code: 0, signal: null }
1285 timing build:run:install:node_modules/node-sass Completed in 3422ms
1286 timing build:run:install Completed in 3424ms
1287 info run node-sass@7.0.1 postinstall node_modules/node-sass node scripts/build.js
1288 info run node-sass@7.0.1 postinstall { code: 1, signal: null }
1289 timing reify:rollback:createSparse Completed in 3941ms
1290 timing reify:rollback:retireShallow Completed in 0ms
1291 timing command:i Completed in 85529ms
1292 verbose stack Error: command failed
1292 verbose stack at ChildProcess. (C:\MyDrive\Softwares\nvm\v16.15.1\node_modules\npm\node_modules@npmcli\promise-spawn\lib\index.js:63:27)
1292 verbose stack at ChildProcess.emit (node:events:527:28)
1292 verbose stack at maybeClose (node:internal/child_process:1092:16)
1292 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
1293 verbose pkgid node-sass@7.0.1
1294 verbose cwd C:\MyDrive\Projects\MyWorks\nodejs
1295 verbose Windows_NT 10.0.19044
1296 verbose node v16.15.1
1297 verbose npm v8.13.1
1298 error code 1
1299 error path C:\MyDrive\Projects\MyWorks\nodejs\node_modules\node-sass
1300 error command failed
1301 error command C:\WINDOWS\system32\cmd.exe /d /s /c C:\Users\OJL1KOR\AppData\Local\Temp\postinstall-1656492368564.cmd
1302 error Building: C:\Program Files\nodejs\node.exe C:\MyDrive\Projects\MyWorks\nodejs\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
1303 error gyp info it worked if it ends with ok
1303 error gyp verb cli [
1303 error gyp verb cli 'C:\Program Files\nodejs\node.exe',
1303 error gyp verb cli 'C:\MyDrive\Projects\MyWorks\nodejs\node_modules\node-gyp\bin\node-gyp.js',
1303 error gyp verb cli 'rebuild',
1303 error gyp verb cli '--verbose',
1303 error gyp verb cli '--libsass_ext=',
1303 error gyp verb cli '--libsass_cflags=',
1303 error gyp verb cli '--libsass_ldflags=',
1303 error gyp verb cli '--libsass_library='
1303 error gyp verb cli ]
1303 error gyp info using node-gyp@8.4.1
1303 error gyp info using node@16.15.1 | win32 | x64
1303 error gyp verb command rebuild []
1303 error gyp verb command clean []
1303 error gyp verb clean removing "build" directory
1303 error gyp verb command configure []
1303 error gyp verb find Python checking Python explicitly set from command line or npm configuration
1303 error gyp verb find Python - "--python=" or "npm config get python" is "C:\MyDrive\Softwares\Python310\python.exe"
1303 error gyp verb find Python - executing "C:\MyDrive\Softwares\Python310\python.exe" to get executable path
1303 error gyp verb find Python - executable path is "C:\MyDrive\Softwares\Python310\python.exe"
1303 error gyp verb find Python - executing "C:\MyDrive\Softwares\Python310\python.exe" to get version
1303 error gyp verb find Python - version is "3.10.4"
1303 error gyp info find Python using Python version 3.10.4 found at "C:\MyDrive\Softwares\Python310\python.exe"
1303 error gyp verb get node dir no --target version specified, falling back to host node version: 16.15.1
1303 error gyp verb command install [ '16.15.1' ]
1303 error gyp verb install input version string "16.15.1"
1303 error gyp verb install installing version: 16.15.1
1303 error gyp verb install --ensure was passed, so won't reinstall if already installed
1303 error gyp verb install version not already installed, continuing with install 16.15.1
1303 error gyp verb ensuring nodedir is created C:\Users\OJL1KOR\AppData\Local\node-gyp\Cache\16.15.1
1303 error gyp verb created nodedir C:\Users\OJL1KOR\AppData\Local\node-gyp\Cache\16.15.1
1303 error gyp http GET https://nodejs.org/download/release/v16.15.1/node-v16.15.1-headers.tar.gz
1303 error gyp http 407 https://nodejs.org/download/release/v16.15.1/node-v16.15.1-headers.tar.gz
1303 error gyp WARN install got an error, rolling back install
1303 error gyp verb command remove [ '16.15.1' ]
1303 error gyp verb remove using node-gyp dir: C:\Users\OJL1KOR\AppData\Local\node-gyp\Cache
1303 error gyp verb remove removing target version: 16.15.1
1303 error gyp verb remove removing development files for version: 16.15.1
1303 error gyp ERR! configure error
1303 error gyp ERR! stack Error: 407 response downloading https://nodejs.org/download/release/v16.15.1/node-v16.15.1-headers.tar.gz
1303 error gyp ERR! stack at go (C:\MyDrive\Projects\MyWorks\nodejs\node_modules\node-gyp\lib\install.js:153:17)
1303 error gyp ERR! stack at processTicksAndRejections (node:internal/process/task_queues:96:5)
1303 error gyp ERR! stack at async install (C:\MyDrive\Projects\MyWorks\nodejs\node_modules\node-gyp\lib\install.js:62:18)
1303 error gyp ERR! System Windows_NT 10.0.19044
1303 error gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\MyDrive\Projects\MyWorks\nodejs\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
1303 error gyp ERR! cwd C:\MyDrive\Projects\MyWorks\nodejs\node_modules\node-sass
1303 error gyp ERR! node -v v16.15.1
1303 error gyp ERR! node-gyp -v v8.4.1
1303 error gyp ERR! not ok
1303 error Build failed with error code: 1
1304 verbose exit 1
1305 timing npm Completed in 86101ms
1306 verbose unfinished npm timer reify 1656492291518
1307 verbose unfinished npm timer reify:build 1656492364853
1308 verbose unfinished npm timer build 1656492364853
1309 verbose unfinished npm timer build:deps 1656492364853
1310 verbose unfinished npm timer build:run:postinstall 1656492368460
1311 verbose unfinished npm timer build:run:postinstall:node_modules/node-sass 1656492368460
1312 verbose code 1
1313 error A complete log of this run can be found in:

same with me

1303 error gyp ERR! stack Error: 407 response downloading

You're running into an issue with a proxy if you're getting a 407 reponse. Nothing we can help you with.

The other saying "same", it's more likely you're not running a compatible version of Node/node-sass https://github.com/sass/node-sass#node-version-support-policy

Hi Team,

I have already installed npm as well as i fired this command ( install npm)

Please help

npm ERR! ../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/binding.cpp:284:98: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
npm ERR! 284 | int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
npm ERR! | ^~~~~~~~~~~~
npm ERR! ../src/binding.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE render_file(Nan::NAN_METHOD_ARGS_TYPE)’:
npm ERR! ../src/binding.cpp:320:98: warning: cast between incompatible function types from ‘void ()(uv_work_t)’ {aka ‘void ()(uv_work_s)’} to ‘uv_after_work_cb’ {aka ‘void ()(uv_work_s, int)’} [-Wcast-function-type]
npm ERR! 320 | int status = uv_queue_work(uv_default_loop(), &ctx_w->request, compile_it, (uv_after_work_cb)MakeCallback);
npm ERR! | ^~~~~~~~~~~~
npm ERR! In file included from ../../nan/nan.h:54,
npm ERR! from ../src/binding.cpp:1:
npm ERR! ../src/binding.cpp: At global scope:
npm ERR! /root/.node-gyp/17.9.0/include/node/node.h:848:43: warning: cast between incompatible function types from ‘void ()(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void ()(v8::Localv8::Object)’} to ‘node::addon_register_func’ {aka ‘void ()(v8::Localv8::Object, v8::Localv8::Value, void)’} [-Wcast-function-type]
npm ERR! 848 | (node::addon_register_func) (regfunc),
npm ERR! | ^
npm ERR! /root/.node-gyp/17.9.0/include/node/node.h:882:3: note: in expansion of macro ‘NODE_MODULE_X’
npm ERR! 882 | NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
npm ERR! | ^~~~~~~~~~~~~
npm ERR! ../src/binding.cpp:358:1: note: in expansion of macro ‘NODE_MODULE’
npm ERR! 358 | NODE_MODULE(binding, RegisterModule);
npm ERR! | ^~~~~~~~~~~
npm ERR! make: *** [binding.target.mk:133: Release/obj.target/binding/src/binding.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/edx/app/edxapp/edx-platform/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.49-linuxkit
npm ERR! gyp ERR! command "/usr/bin/node" "/edx/app/edxapp/edx-platform/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd /edx/app/edxapp/edx-platform/node_modules/node-sass
npm ERR! gyp ERR! node -v v17.9.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
npm verb exit 1
npm timing npm Completed in 366613ms
npm verb unfinished npm timer reify 1670501055901
npm verb unfinished npm timer reify:build 1670501241704
npm verb unfinished npm timer build 1670501241713
npm verb unfinished npm timer build:deps 1670501241714
npm verb unfinished npm timer build:run:postinstall 1670501244997
npm verb unfinished npm timer build:run:postinstall:node_modules/node-sass 1670501244997
npm verb code 1

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-12-08T12_04_15_484Z-debug-0.log