Artem71
@Artem71
Начинающий верстальщик

Ошибка при установке пакета gulp-sass?

Здраствуйте! Хотел описать проблему. При установке пакета gulp-sass вылезает ошибка.Установка выполняется через node.js командой npm i gulp-sass. Вот весь вывод после ввода команды.
> node-sass@4.11.0 install C:\Users\agani\Desktop\Gulp\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/downloa...
Cannot download "https://github.com/sass/node-sass/releases/downloa...":

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=example.com:1234

or configure npm proxy via

npm config set proxy example.com:8080

> node-sass@4.11.0 postinstall C:\Users\agani\Desktop\Gulp\node_modules\node-sass
> node scripts/build.js

Building: C:\Program Files\nodejs\node.exe C:\Users\agani\Desktop\Gulp\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 [
gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli 'C:\\Users\\agani\\Desktop\\Gulp\\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 verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.0.0 | win32 | 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` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (C:\Users\agani\Desktop\Gulp\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\agani\Desktop\Gulp\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\agani\Desktop\Gulp\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\agani\Desktop\Gulp\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\agani\Desktop\Gulp\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\agani\Desktop\Gulp\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:166:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (C:\Users\agani\Desktop\Gulp\node_modules\which\which.js:13:12)
gyp verb `which` failed at F (C:\Users\agani\Desktop\Gulp\node_modules\which\which.js:68:19)
gyp verb `which` failed at E (C:\Users\agani\Desktop\Gulp\node_modules\which\which.js:80:29)
gyp verb `which` failed at C:\Users\agani\Desktop\Gulp\node_modules\which\which.js:89:16
gyp verb `which` failed at C:\Users\agani\Desktop\Gulp\node_modules\isexe\index.js:42:5
gyp verb `which` failed at C:\Users\agani\Desktop\Gulp\node_modules\isexe\windows.js:36:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:166:21) {
gyp verb `which` failed stack: 'Error: not found: python2\n at getNotFoundError ' +
gyp verb `which` failed '(C:\\Users\\agani\\Desktop\\Gulp\\node_modules\\which\\which.js:13:12)\n at F ' +
gyp verb `which` failed '(C:\\Users\\agani\\Desktop\\Gulp\\node_modules\\which\\which.js:68:19)\n at E ' +
gyp verb `which` failed '(C:\\Users\\agani\\Desktop\\Gulp\\node_modules\\which\\which.js:80:29)\n at ' +
gyp verb `which` failed 'C:\\Users\\agani\\Desktop\\Gulp\\node_modules\\which\\which.js:89:16\n at ' +
gyp verb `which` failed 'C:\\Users\\agani\\Desktop\\Gulp\\node_modules\\isexe\\index.js:42:5\n at ' +
gyp verb `which` failed 'C:\\Users\\agani\\Desktop\\Gulp\\node_modules\\isexe\\windows.js:36:5\n at ' +
gyp verb `which` failed 'FSReqCallback.oncomplete (fs.js:166:21)',
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python C:\Users\agani\AppData\Local\Programs\Python\Python37-32\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\agani\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:304:12)
gyp ERR! stack at ChildProcess.emit (events.js:196:13)
gyp ERR! stack at maybeClose (internal/child_process.js:1000:16)
gyp ERR! stack at Socket. (internal/child_process.js:405:11)
gyp ERR! stack at Socket.emit (events.js:196:13)
gyp ERR! stack at Pipe. (net.js:586:12)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\agani\\Desktop\\Gulp\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\agani\Desktop\Gulp\node_modules\node-sass
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN my@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.8 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.8: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.11.0 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! C:\Users\agani\AppData\Roaming\npm-cache\_logs\2019-04-24T15_57_27_492Z-debug.log
P.S.
Заметил что-то связаное с python:
stack Error: Command failed: C:\Users\agani\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
И то что проблема не с node.js
  • Вопрос задан
  • 1185 просмотров
Решения вопроса 2
mmmaaak
@mmmaaak
судя по readme от node-gyp с гитхаба:
On Windows
Option 1
Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator).

Option 2
Install tools and configuration manually:

Install Visual C++ Build Environment: Visual Studio Build Tools (using "Visual C++ build tools" workload) or Visual Studio 2017 Community (using the "Desktop development with C++" workload)
Install Python 2.7 (v3.x.x is not supported), and run npm config set python python2.7 (or see below for further instructions on specifying the proper Python version and path.)
Launch cmd, npm config set msvs_version 2017


а в логах говорится, что он нашел третий питон
Ответ написан
Artem71
@Artem71 Автор вопроса
Начинающий верстальщик
В общем решение такое нужно иметь Node.js последней версии и ввести команду npm install --global windows-build-tools все
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы