Hendrx
Hendrx

Reputation: 101

gyp verb `which` failed Error: not found: python2 for yarn add node-sass command

i'm working on a project and need to add sass loader to my project dependency which needs node sass in order to work. i installed sass loader with

yarn add [email protected]

and it worked well. But when i tried to install node-sass using this:

yarn add [email protected]

warning " > [email protected]" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
[4/4] Building fresh packages...
[-/3] ⢀ waiting...
[-/3] ⠠ waiting...
error C:\Users\IT\Desktop\react-course-projects\indecision-app\node_modules\node-sass: Command failed.
Exit code: 1
Command: node scripts/build.js
Arguments:
Directory: C:\Users\IT\Desktop\react-course-projects\indecision-app\node_modules\node-sass
Output:
Building: C:\Program Files\nodejs\node.exe C:\Users\IT\Desktop\react-course-projects\indecision-app\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
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] | win32 | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure [],
gyp verb `which` failed   code: 'ENOENT' }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (C:\Users\IT\Desktop\react-course-projects\indecision-app\node_modules\which\which.js:13:12)
gyp verb `which` failed     at FSReqWrap.oncomplete (fs.js:153:21)
gyp verb `which` failed   stack:
gyp verb `which` failed    'Error: not found: python\n    at getNotFoundError 
gyp verb `which` failed   code: 'ENOENT' }
gyp verb could not find "python". checking python launcher
gyp verb could not find "python". guessing location
gyp verb ensuring that file exists: C:\Python27\python.exe
gyp verb check python version `C:\Python27\python.exe -c "import sys; print "2.7.0
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 10.16.3
gyp info spawn C:\Python27\python.exe
gyp info spawn args [ 'C:\\Users\\IT\\Desktop\\react-course-projects\\indecision-app\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\IT\\Desktop\\react-course-projects\\indecision-app\\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   'C:\\Users\\IT\\Desktop\\react-course-projects\\indecision-app\\node_modules\\node-sass\\build',
gyp info spawn args   '-Goutput_dir=.' ]
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
gyp verb command build []
gyp verb build type Release
gyp verb architecture x64
gyp verb node dev dir C:\Users\IT\.node-gyp\10.16.3
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe" in PATH - finding location in registry
gyp ERR! build error
gyp ERR! stack Error: Command failed: reg query "HKLM\Software\Microsoft\MSBuild\ToolsVersions" /s /reg:32
gyp ERR! stack 'reg' is not recognized as an internal or external command,
gyp ERR! stack operable program or batch file.
gyp ERR! stack
gyp ERR! stack Can't find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?gyp ERR! stack     at C:\Users\IT\Desktop\react-course-projects\indecision-app\node_modules\node-gyp\lib\build.js:142:25
"C:\\Users\\IT\\Desktop\\react-course-projects\\indecision-app\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\Users\IT\Desktop\react-course-projects\indecision-app\node_modules\node-sass
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok`enter code here`

i tried removing node modules and installing it back i didn't work node -v 10.16.0 npm -v 6.9.0

Upvotes: 1

Views: 7761

Answers (1)

nschonni
nschonni

Reputation: 4129

Looks like [email protected] uses an older node-sass dependency that isn't supported by node-sass. I'd try using sass-loader@latest to see if it's using at least node-sass 4.9 for Node 10 support https://github.com/sass/node-sass#supported-nodejs-versions-vary-by-release-please-consult-the-releases-page-below-is-a-quick-guide-for-minimum-support

Upvotes: 2

Related Questions