0

I am trying to install ffi but I am getting an error. I have installed all the dependencies i.e. python and windows build tools before installing ffi.

Below is the complete error that I am getting:

npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path E:\xampp\htdocs\Start\test\node_modules\ffi
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.18.0 | win32 | x64
npm ERR! (node:8368) [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 info spawn C:\Users\amit.joshi\.windows-build-tools\python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'E:\\xampp\\htdocs\\Start\\test\\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   '-G',
npm ERR! gyp info spawn args   'msvs_version=2017',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'E:\\xampp\\htdocs\\Start\\test\\node_modules\\ffi\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'E:\\xampp\\htdocs\\Start\\test\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
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\\x\\.node-gyp\\16.18.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=E:\\xampp\\htdocs\\Start\\test\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\Users\\xxxx\\.node-gyp\\16.18.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=E:\\xampp\\htdocs\\Start\\test\\node_modules\\ffi',
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   'E:\\xampp\\htdocs\\Start\\test\\node_modules\\ffi\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
npm ERR!     sys.exit(gyp.script_main())
npm ERR!   File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main
npm ERR!     return main(sys.argv[1:])
npm ERR!   File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main
npm ERR!     return gyp_main(args)
npm ERR!   File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 514, in gyp_main
npm ERR!     options.duplicate_basename_check)
npm ERR!   File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion
npm ERR!     versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
npm ERR! KeyError: '2017'
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (E:\xampp\htdocs\Start\test\node_modules\node-gyp\lib\configure.js:345:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\xampp\\htdocs\\Start\\test\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"        
npm ERR! gyp ERR! cwd E:\xampp\htdocs\Start\test\node_modules\ffi
npm ERR! gyp ERR! node -v v16.18.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

Not sure how to fix this.

James Z
  • 12,209
  • 10
  • 24
  • 44
amit joshi
  • 39
  • 4

0 Answers0