Node-gyp: fatal error LNK1107: invalid or corrupt file: cannot read at 0x186E7

Created on 7 Feb 2018  Â·  1Comment  Â·  Source: nodejs/node-gyp

  • Node Version: v9.4.0
  • Platform: Windows 10
  • Module: Electron

Verbose output (from npm or node-gyp):

PS D:\Mine\Projects (NON-Bot)\Rocket.Chat.Electron> yarn
yarn install v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/5] â „ @paulcbetts/system-idle-time: C:\Users\Ahmed\.node-gyp\iojs-1.2.1\x64\iojs.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x186E76 [D:\Mine\Projects (NON-Bot)\Rocket.Chat.Electron\node_modules\@paulcb
[-/5] â¡€ waiting...
[3/5] â¡€ spellchecker: transcoder_win.cc
[4/5] â¡€ electron
error D:\Mine\Projects (NON-Bot)\Rocket.Chat.Electron\node_modules\@paulcbetts\system-idle-time: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: D:\Mine\Projects (NON-Bot)\Rocket.Chat.Electron\node_modules\@paulcbetts\system-idle-time
Output:
D:\Mine\Projects (NON-Bot)\Rocket.Chat.Electron\node_modules\@paulcbetts\system-idle-time>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info spawn C:\Users\Ahmed\.windows-build-tools\python27\python.exe
gyp info spawn args [ 'C:\\Program Files\\nodejs\\node_modules\\npm\\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=2015',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Mine\\Projects (NON-Bot)\\Rocket.Chat.Electron\\node_modules\\@paulcbetts\\system-idle-time\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Ahmed\\.node-gyp\\iojs-1.2.1\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Ahmed\\.node-gyp\\iojs-1.2.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\Users\\Ahmed\\.node-gyp\\iojs-1.2.1\\<(target_arch)\\iojs.lib',
gyp info spawn args   '-Dmodule_root_dir=D:\\Mine\\Projects (NON-Bot)\\Rocket.Chat.Electron\\node_modules\\@paulcbetts\\system-idle-time',
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   'D:\\Mine\\Projects (NON-Bot)\\Rocket.Chat.Electron\\node_modules\\@paulcbetts\\system-idle-time\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  module.cc
  idle.cc
  win_delay_load_hook.cc
C:\Users\Ahmed\.node-gyp\iojs-1.2.1\x64\iojs.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x186E76 [D:\Mine\Projects (NON-Bot)\Rocket.Chat.Electron\node_modules\@paulcbetts\system-idle-time\build\system_idle_time.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:160:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Mine\Projects (NON-Bot)\Rocket.Chat.Electron\node_modules\@paulcbetts\system-idle-time





I have been trying to install Rocket-Chat but when i tried to to run yarn the above output what i used to get .

Any possible solution ?

Most helpful comment

C:\UsersAhmed.node-gyp\iojs-1.2.1x64\iojs.lib

You're not linking to the right lib file. Clean out your .node-gyp folder and try again.

>All comments

C:\UsersAhmed.node-gyp\iojs-1.2.1x64\iojs.lib

You're not linking to the right lib file. Clean out your .node-gyp folder and try again.

Was this page helpful?
0 / 5 - 0 ratings