samples icon indicating copy to clipboard operation
samples copied to clipboard

npm gyp error when trying to run the sample

Open AvtsVivek opened this issue 4 years ago • 1 comments

I am trying to run this hello-typescript sample.

PS > node --version v16.13.2

When I run the third step npm install, I get the following error.

npm ERR! gyp ERR! cwd E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error 

Not sure what I am missing.

Here is the log file that got generated in the folder C:\Users\UserName\AppData\Local\npm-cache_logs

2022-01-20T04_52_56_304Z-debug.log

AvtsVivek avatar Jan 20 '22 05:01 AvtsVivek

Looks fine now. I did two things.

  1. From this so answer, I ran the following command. npm config set msbuild_path "C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe"

  2. I deleted the package-lock.json and then ran npm install a couple of times.

I restarted the machine, deleted the node modules folder, ran npm install again. Not sure what worked, but things look fine now.

image

The complete error list is as follows for reference.

1051 error code 1 1052 error path E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc 1053 error command failed 1054 error command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build --library=static_library 1055 error Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) 1056 error node-pre-gyp info it worked if it ends with ok 1056 error node-pre-gyp info using [email protected] 1056 error node-pre-gyp info using [email protected] | win32 | x64 1056 error node-pre-gyp WARN Using needle for node-pre-gyp https download 1056 error node-pre-gyp info check checked for "E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node" (not found) 1056 error node-pre-gyp http GET https://node-precompiled-binaries.grpc.io/grpc/v1.24.3/node-v93-win32-x64-unknown.tar.gz 1056 error node-pre-gyp http 404 https://node-precompiled-binaries.grpc.io/grpc/v1.24.3/node-v93-win32-x64-unknown.tar.gz 1056 error node-pre-gyp WARN Tried to download(404): https://node-precompiled-binaries.grpc.io/grpc/v1.24.3/node-v93-win32-x64-unknown.tar.gz 1056 error node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v93 ABI, unknown) (falling back to source compile with node-gyp) 1056 error node-pre-gyp http 404 status code downloading tarball https://node-precompiled-binaries.grpc.io/grpc/v1.24.3/node-v93-win32-x64-unknown.tar.gz 1056 error gyp info it worked if it ends with ok 1056 error gyp info using [email protected] 1056 error gyp info using [email protected] | win32 | x64 1056 error gyp info ok 1056 error gyp info it worked if it ends with ok 1056 error gyp info using [email protected] 1056 error gyp info using [email protected] | win32 | x64 1056 error gyp info find Python using Python version 3.11.0 found at "C:\Program Files\Python\python.exe" 1056 error gyp http GET https://nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz 1056 error gyp http 200 https://nodejs.org/download/release/v16.13.2/node-v16.13.2-headers.tar.gz 1056 error gyp http GET https://nodejs.org/download/release/v16.13.2/SHASUMS256.txt 1056 error gyp http GET https://nodejs.org/download/release/v16.13.2/win-x86/node.lib 1056 error gyp http GET https://nodejs.org/download/release/v16.13.2/win-arm64/node.lib 1056 error gyp http GET https://nodejs.org/download/release/v16.13.2/win-x64/node.lib 1056 error gyp http 200 https://nodejs.org/download/release/v16.13.2/SHASUMS256.txt 1056 error gyp http 200 https://nodejs.org/download/release/v16.13.2/win-x64/node.lib 1056 error gyp http 200 https://nodejs.org/download/release/v16.13.2/win-x86/node.lib 1056 error gyp http 404 https://nodejs.org/download/release/v16.13.2/win-arm64/node.lib 1056 error gyp ERR! find VS 1056 error gyp ERR! find VS msvs_version not set from command line or npm config 1056 error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt 1056 error gyp ERR! find VS unknown version "undefined" found at "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" 1056 error gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use 1056 error gyp ERR! find VS looking for Visual Studio 2015 1056 error gyp ERR! find VS - not found 1056 error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 1056 error gyp ERR! find VS 1056 error gyp ERR! find VS ************************************************************** 1056 error gyp ERR! find VS You need to install the latest version of Visual Studio 1056 error gyp ERR! find VS including the "Desktop development with C++" workload. 1056 error gyp ERR! find VS For more information consult the documentation at: 1056 error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows 1056 error gyp ERR! find VS ************************************************************** 1056 error gyp ERR! find VS 1056 error gyp ERR! configure error 1056 error gyp ERR! stack Error: Could not find any Visual Studio installation to use 1056 error gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47) 1056 error gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16 1056 error gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14) 1056 error gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14 1056 error gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16 1056 error gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7 1056 error gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16 1056 error gyp ERR! stack at ChildProcess.exithandler (node:child_process:404:5) 1056 error gyp ERR! stack at ChildProcess.emit (node:events:390:28) 1056 error gyp ERR! stack at maybeClose (node:internal/child_process:1064:16) 1056 error gyp ERR! System Windows_NT 10.0.22000 1056 error gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node" "--module_name=grpc_node" "--module_path=E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93" 1056 error gyp ERR! cwd E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc 1056 error gyp ERR! node -v v16.13.2 1056 error gyp ERR! node-gyp -v v8.3.0 1056 error gyp ERR! not ok 1056 error node-pre-gyp ERR! build error 1056 error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) 1056 error node-pre-gyp ERR! stack at ChildProcess. (E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\node-pre-gyp\lib\util\compile.js:83:29) 1056 error node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28) 1056 error node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064:16) 1056 error node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) 1056 error node-pre-gyp ERR! System Windows_NT 10.0.22000 1056 error node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library" 1056 error node-pre-gyp ERR! cwd E:\Vivek\Trials\Ddd\Dapr\Samples\hello-typescript\node_modules\grpc 1056 error node-pre-gyp ERR! node -v v16.13.2 1056 error node-pre-gyp ERR! node-pre-gyp -v v0.15.0 1056 error node-pre-gyp ERR! not ok

AvtsVivek avatar Jan 20 '22 05:01 AvtsVivek

Resolving as complete

msfussell avatar Aug 01 '23 00:08 msfussell