0

I am getting below error, while running npm install. Is there anything need to be done in nodejs or some other issue. I am getting below error, whenever I use npm, for example, npm install -g firebase-tools,npm install gulp.

node-pre-gyp ERR! Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.7.3/node-v64-wi
    n32-x64-unknown.tar.gz
    node-pre-gyp ERR! Pre-built binaries not found for grpc@1.7.3 and node@10.0.0 (node-v64 ABI, unknown) (falling back to source c
    ompile with node-gyp)
    gyp ERR! configure error
    gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
    gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.j
    s:483:19)
    gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js
    :508:16)
    gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
    gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:149:21)
    gyp ERR! System Windows_NT 6.1.7601
    gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\b
    in\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\\DEV\\Google Home\\Creating Sample\\
    TestSet-up\\functions\\node_modules\\dialogflow\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown\\g
    rpc_node.node" "--module_name=grpc_node" "--module_path=C:\\DEV\\Google Home\\Creating Sample\\TestSet-up\\functions\\node_modu
    les\\dialogflow\\node_modules\\grpc\\src\\node\\extension_binary\\node-v64-win32-x64-unknown"
    gyp ERR! cwd C:\DEV\Google Home\Creating Sample\TestSet-up\functions\node_modules\dialogflow\node_modules\grpc
    gyp ERR! node -v v10.0.0
    gyp ERR! node-gyp -v v3.6.2
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\nod
    e_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\DEV\Google Home\Creating
    Sample\TestSet-up\functions\node_modules\dialogflow\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc
    _node.node --module_name=grpc_node --module_path=C:\DEV\Google Home\Creating Sample\TestSet-up\functions\node_modules\dialogflo
    w\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown' (1)
    node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\DEV\Google Home\Creating Sample\TestSet-up\functions\node_modules\d
    ialogflow\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
    node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
    node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:947:16)
    node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
    node-pre-gyp ERR! System Windows_NT 6.1.7601
    node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\DEV\\Google Home\\Creating Sample\\TestSet-up\\functions\\
    node_modules\\dialogflow\\node_modules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "-
    -library=static_library"
    node-pre-gyp ERR! cwd C:\DEV\Google Home\Creating Sample\TestSet-up\functions\node_modules\dialogflow\node_modules\grpc
    node-pre-gyp ERR! node -v v10.0.0
    node-pre-gyp ERR! node-pre-gyp -v v0.6.39
    node-pre-gyp ERR! not ok
    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=C:\DEV\Google Home\Creating Sample\TestSet-up\functions\nod
    e_modules\dialogflow\node_modules\grpc\src\node\extension_binary\node-v64-win32-x64-unknown\grpc_node.node --module_name=grpc_n
    ode --module_path=C:\DEV\Google Home\Creating Sample\TestSet-up\functions\node_modules\dialogflow\node_modules\grpc\src\node\ex
    tension_binary\node-v64-win32-x64-unknown' (1)
    npm WARN The package gulp is included as both a dev and production dependency.

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! grpc@1.7.3 install: `node-pre-gyp install --fallback-to-build --library=static_library`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the grpc@1.7.3 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\selvamt\AppData\Roaming\npm-cache\_logs\2018-07-17T11_11_19_375Z-debug.log
Sridhar
  • 11,466
  • 5
  • 39
  • 43
Thirumani
  • 45
  • 1
  • 10
  • I had faced such a problem at past in linux and I got that solved by `sudo apt-get install build-essential` then removing the `node_modules` and doing `npm install` again. Hope this helps you. – Ankit Agarwal Jul 17 '18 at 11:35
  • @AnkitAgarwal Looks like it is windows. –  Jul 17 '18 at 12:02
  • @thirumani, Can you please try npm install grpc and tell me what's the error? –  Jul 17 '18 at 12:05
  • @AnkitAgarwal is right you have to install build essential for windows – Sandeep Patel Jul 19 '18 at 09:34
  • please check this out https://stackoverflow.com/questions/35293117/npm-install-that-requires-node-gyp-fails-on-windows – Sandeep Patel Jul 19 '18 at 09:36

2 Answers2

4

This problems occurred when we don't have correct build tool in our system.SO you need to install build essential for windows. You can install build essential for windows with NPM. But it will take time so don't loose patience

npm install -g windows-build-tools

Make sure to do it in an elevated command prompt (i.e. as an Administrator).

Saran
  • 3,845
  • 3
  • 37
  • 59
Sandeep Patel
  • 4,815
  • 3
  • 21
  • 37
1

Node.js now includes build tools for Windows. You probably no longer need this tool. See https://github.com/felixrieseberg/windows-build-tools for details

nekrofxk
  • 61
  • 8