node-sass ошибка при установке зависимостей для темы WordPress Understrap - PullRequest
0 голосов
/ 11 ноября 2019

Я уже некоторое время без проблем использую тему Understrap для WordPress, но сегодня я получаю ошибку node-sass при запуске команды yarn install для установки зависимостей темы.

Я читал, что последняя версия node-sass выдает ошибку при попытке установить его, поэтому я попытался установить его с помощью команды yarn add node-sass@4.13, но это не работаетпоскольку один из пакетов в теме Understrap связан с последней версией node-sass , которая вызывает эту ошибку. Вот полный журнал ошибок, который я получаю:

error C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\gulp-sass\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\gulp-sass\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\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:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\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.13.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:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158: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\Ben\AppData\Local\Programs\Python\Python37-32\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\Ben\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v12.13.0




PS C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child> yarn install node-sass@4.13
yarn install v1.13.0
error `install` has been replaced with `add` to add new dependencies. Run "yarn add node-sass@4.13" instead.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
PS C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child> yarn install node-sass@4.13
yarn install v1.13.0
error `install` has been replaced with `add` to add new dependencies. Run "yarn add node-sass@4.13" instead.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
PS C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child> yarn add node-sass@4.13
yarn add v1.13.0
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.7: The platform "win32" is incompatible with this module.
info "fsevents@1.2.7" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
[4/4] Building fresh packages...
[-/6] ⠠ waiting...
[-/6] ⠠ waiting...
[-/6] ⠠ waiting...
[4/6] ⠠ node-sass
error C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\gulp-sass\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\gulp-sass\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\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:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\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.13.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:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:13:12)
gyp verb `which` failed     at F (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:68:19)
gyp verb `which` failed     at E (C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:80:29)
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\which\which.js:89:16
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\isexe\index.js:42:5
gyp verb `which` failed     at C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\isexe\windows.js:36:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:158:21) {
gyp verb `which` failed   stack: 'Error: not found: python2\n' +
gyp verb `which` failed     '    at getNotFoundError (C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\which\\which.js:13:12)\n' +
gyp verb `which` failed     '    at F (C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\which\\which.js:68:19)\n' +
gyp verb `which` failed     '    at E (C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\which\\which.js:80:29)\n' +
gyp verb `which` failed     '    at C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\which\\which.js:89:16\n' +
gyp verb `which` failed     '    at C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\isexe\\index.js:42:5\n' +
gyp verb `which` failed     '    at C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\isexe\\windows.js:36:5\n' +
gyp verb `which` failed     '    at FSReqCallback.oncomplete (fs.js:158: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\Ben\AppData\Local\Programs\Python\Python37-32\python.EXE
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\Ben\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", 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:295:12)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\xampp\\htdocs\\pug_test\\wp-content\\themes\\understrap-child\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cs_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\xampp\htdocs\pug_test\wp-content\themes\understrap-child\node_modules\gulp-sass\node_modules\node-sass
gyp ERR! node -v v12.13.0

Кто-нибудь еще использует эту тему WordPress? Если да, знаете ли вы, как я могу отредактировать package.json, чтобы решить эту проблему с помощью node-sass? Большое спасибо.

...