Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error running install script for optional dependency" on Windows #90

Open
kaiyoma opened this issue Apr 11, 2018 · 1 comment
Open

Comments

@kaiyoma
Copy link

kaiyoma commented Apr 11, 2018

After adding esprint to our project recently, yarn installed node-weak as well, but the post-install script fails on Windows:

yarn install v1.5.1
[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...
warning " > [email protected]" has unmet peer dependency "[email protected] || 0.20.x || 0.22.x || ^1.0.0-0".
warning " > [email protected]" has unmet peer dependency "karma@>=0.9".
[4/4] Building fresh packages...
warning Error running install script for optional dependency: "C:\\Users\\<User>\\Work\\<project>\
ode_modules\\weak: Command failed.
Exit code: 1
Command: C:\\WINDOWS\\system32\\cmd.exe
Arguments: /d /s /c node-gyp rebuild
Directory: C:\\Users\\<User>\\Work\\<project>\
ode_modules\\weak
Output:
C:\\Users\\<User>\\Work\\<project>\
ode_modules\\weak>if not defined npm_config_node_gyp (node \"C:\\Program Files\\Node.js\
ode_modules\
pm\\bin\
ode-gyp-bin\\\\..\\..\
ode_modules\
ode-gyp\\bin\
ode-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 http GET https://nodejs.org/download/release/v8.9.0/node-v8.9.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v8.9.0/node-v8.9.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v8.9.0/SHASUMS256.txt
gyp http GET https://nodejs.org/download/release/v8.9.0/win-x86/node.lib
gyp http GET https://nodejs.org/download/release/v8.9.0/win-x64/node.lib
gyp http 200 https://nodejs.org/download/release/v8.9.0/win-x86/node.lib
gyp http 200 https://nodejs.org/download/release/v8.9.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v8.9.0/win-x64/node.lib
gyp info spawn C:\\Program Files\\Python\\python.EXE
gyp info spawn args [ 'C:\\\\Program Files\\\\Node.js\\\
ode_modules\\\
pm\\\
ode_modules\\\
ode-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   'C:\\\\Users\\\\<User>\\\\Work\\\\<project>\\\
ode_modules\\\\weak\\\\build\\\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Program Files\\\\Node.js\\\
ode_modules\\\
pm\\\
ode_modules\\\
ode-gyp\\\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\\\Users\\\\<User>\\\\.node-gyp\\\\8.9.0\\\\include\\\
ode\\\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\\\Users\\\\<User>\\\\.node-gyp\\\\8.9.0',
gyp info spawn args   '-Dnode_gyp_dir=C:\\\\Program Files\\\\Node.js\\\
ode_modules\\\
pm\\\
ode_modules\\\
ode-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\<User>\\\\.node-gyp\\\\8.9.0\\\\<(target_arch)\\\
ode.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\\\Users\\\\<User>\\\\Work\\\\<project>\\\
ode_modules\\\\weak',
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\\\\<User>\\\\Work\\\\<project>\\\
ode_modules\\\\weak\\\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\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.
MSBUILD : error MSB4132: The tools version \"2.0\" is unrecognized. Available tools versions are \"4.0\".
gyp ERR! build error
gyp ERR! stack Error: `C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\\Program Files\\Node.js\
ode_modules\
pm\
ode_modules\
ode-gyp\\lib\\build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command \"C:\\\\Program Files\\\\Node.js\\\
ode.exe\" \"C:\\\\Program Files\\\\Node.js\\\
ode_modules\\\
pm\\\
ode_modules\\\
ode-gyp\\\\bin\\\
ode-gyp.js\" \"rebuild\"
gyp ERR! cwd C:\\Users\\<User>\\Work\\<project>\
ode_modules\\weak
gyp ERR! node -v v8.9.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok"
info This module is OPTIONAL, you can safely ignore this error
Done in 38.45s.
@kaiyoma
Copy link
Author

kaiyoma commented Jun 18, 2018

Seems that windows-build-tools is necessary to build this module. More info:

szwacz/electron-boilerplate#279 (comment)
chjj/pty.js#60 (comment)
https://www.npmjs.com/package/windows-build-tools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant