I have reinstalled node completely, I have installed VS 2017 and 2019, installed the 2017 build tools and it says build tools is installed for VS 2019, I have set the version to all versions accepted in the config and nothing works. Every time I did a change I got an error and resolved the error and everything comes back to this one error when I set any version in the console. I have deleted my package-lock.json as this has resolved the issue in the past but that didn't work this time and I'd rather not delete it to fix it every time anyway. I have the most recent version of node (17.0.1). The accepted versions are 2010, 2012, 2013, 2015 but everyone says all they did was install the build tools and it worked. I've installed the build tools by command, and in the installer for each version. I tried uninstalling and reinstalling each version one at a time and trying each one just to make sure it didn't work and tried changing the version in NPM config each time. This is so frustrating and I don't even know why its happening. It started happening randomly and now its seemingly unfixable.
Something to note: As I said I tried setting the config for msvs_version to every acceptable year as well as 2017 and 2019 according to the version I installed. If I don't set it, it tells me to set it, if its wrong, it says it found VS but it doesn't match the msvs version, and if I set it to anything past 2015 (2017 to match my VS version) it says the error below. I tried to get VS 2015 to see if somehow that could possibly work but I couldn't get that to work either.
Many people referred to this fix: Npm install not installing because of node-gyp so I tried following it.
I got mostly through the entire thing with no issue except it says to install node-sass. Except I get the error at the bottom when I try. Assuming this is because the error is that I can't do npm install, and the way they say to fix it is using npm install. I tried every fix out there, then try the one everyone says to use and it breaks it even more. I don't even know how to REVERT all these changes at this point to start from scratch.
Main Error
command C:\Windows\system32\cmd.exe /d /s /c node install.js --preinstall
npm ERR! MS Version: 2017
npm ERR! C:\Users\mason\Desktop\Michiru\node_modules\sodium\install.js:312
npm ERR! console.log('Invalid msvs_version ' + msvsVersion + '\n');
npm ERR! ^
npm ERR!
npm ERR! ReferenceError: msvsVersion is not defined
npm ERR! at errorInvalidMSVSVersion (C:\Users\mason\Desktop\Michiru\node_modules\sodium\install.js:312:43)
npm ERR! at checkMSVSVersion (C:\Users\mason\Desktop\Michiru\node_modules\sodium\install.js:329:9)
npm ERR! at Object.<anonymous> (C:\Users\mason\Desktop\Michiru\node_modules\sodium\install.js:353:5)
npm ERR! at Module._compile (node:internal/modules/cjs/loader:1095:14)
npm ERR! at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
npm ERR! at Module.load (node:internal/modules/cjs/loader:975:32)
npm ERR! at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
npm ERR! at node:internal/main/run_main_module:17:47
npm ERR!
npm ERR! Node.js v17.0.1
Error from Npm install not installing because of node-gyp
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
npm ERR! Build started 10/28/2021 8:39:28 PM.
npm ERR! Project "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\binding.sln" on node 1 (default targets).
npm ERR! ValidateSolutionConfiguration:
npm ERR! Building solution configuration "Release|x64".
npm ERR! Project "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\binding.sln" (1) is building "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) on node 1 (default targets).
npm ERR! Project "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\binding.vcxproj.metaproj" (2) is building "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\src\libsass.vcxproj" (3) on node 1 (default targets).
npm ERR! C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
npm ERR! Done Building Project "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\src\libsass.vcxproj" (default targets) -- FAILED.
npm ERR! Done Building Project "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\binding.vcxproj.metaproj" (default targets) -- FAILED.
npm ERR! Done Building Project "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\binding.sln" (default targets) -- FAILED.
npm ERR!
npm ERR! Build FAILED.
npm ERR!
npm ERR! "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\binding.sln" (default target) (1) ->
npm ERR! "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\binding.vcxproj.metaproj" (default target) (2) ->
npm ERR! "C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\src\libsass.vcxproj" (default target) (3) ->
npm ERR! C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
npm ERR!
npm ERR! 0 Warning(s)
npm ERR! 1 Error(s)
npm ERR!
npm ERR! Time Elapsed 00:00:00.31
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli 'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli 'C:\\Users\\mason\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli 'rebuild',
npm ERR! gyp verb cli '--verbose',
npm ERR! gyp verb cli '--libsass_ext=',
npm ERR! gyp verb cli '--libsass_cflags=',
npm ERR! gyp verb cli '--libsass_ldflags=',
npm ERR! gyp verb cli '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@17.0.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - executable path is "C:\Python310\python.exe"
npm ERR! gyp verb find Python - executing "C:\Python310\python.exe" to get version
npm ERR! gyp verb find Python - version is "3.10.0"
npm ERR! gyp info find Python using Python version 3.10.0 found at "C:\Python310\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 17.0.1
npm ERR! gyp verb command install [ '17.0.1' ]
npm ERR! gyp verb install input version string "17.0.1"
npm ERR! gyp verb install installing version: 17.0.1
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 17.0.1
npm ERR! gyp verb build dir attempting to create "build" dir: C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build
npm ERR! gyp verb build dir "build" dir needed to be created? C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build
npm ERR! gyp verb find VS msvs_version was set from command line or npm config
npm ERR! gyp verb find VS - looking for Visual Studio version 2015
npm ERR! gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp verb find VS checking VS2017 (15.9.28307.1705) found at:
npm ERR! gyp verb find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
npm ERR! gyp verb find VS - found "Visual Studio C++ core features"
npm ERR! gyp verb find VS - found VC++ toolset: v141
npm ERR! gyp verb find VS - found Windows SDK: 10.0.17763.0
npm ERR! gyp verb find VS - msvs_version does not match this version
npm ERR! gyp verb find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp verb find VS looking for Visual Studio 2015
npm ERR! gyp verb find VS - found in "C:\Program Files (x86)\Microsoft Visual Studio 14.0"
npm ERR! gyp verb find VS - MSBuild in "C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe"
npm ERR! gyp info find VS using VS2015 (14.0) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio 14.0"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\build\config.gypi
npm ERR! (node:22828) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp verb config.gypi checking for gypi file: C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "msvs"
npm ERR! gyp info spawn C:\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Users\\mason\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\mason\\AppData\\Roaming\\npm\\node_modules\\node-sass\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\mason\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\mason\\AppData\\Local\\node-gyp\\Cache\\17.0.1\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\mason\\AppData\\Local\\node-gyp\\Cache\\17.0.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\mason\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\mason\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\17.0.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\mason\\AppData\\Roaming\\npm\\node_modules\\node-sass',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\Users\\mason\\AppData\\Roaming\\npm\\node_modules\\node-sass\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir C:\Users\mason\AppData\Local\node-gyp\Cache\17.0.1
npm ERR! gyp verb found first Solution file build/binding.sln
npm ERR! gyp verb using MSBuild: C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe
npm ERR! gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mason\\AppData\\Roaming\\npm\\node_modules\\node-sass\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\mason\AppData\Roaming\npm\node_modules\node-sass
npm ERR! gyp ERR! node -v v17.0.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1