3

I am getting a gyp error when I am executing npm install in my project

gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bakhil\\AppData\\Roaming\\nvm\\v10.15.1\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "clean" "configure"
gyp ERR! cwd C:\Users\bakhil\source\repos\BOSS.Web\node_modules\@newrelic\native-metrics
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

Failed to execute native-metrics install: No pre-built artifacts for your OS/architecture.

I am also getting error when it is executing node-gyp rebuild

> [email protected] install C:\Users\bakhil\source\repos\BOSS.Web\node_modules\mmmagic
> node-gyp rebuild


C:\Users\bakhil\source\repos\BOSS.Web\node_modules\mmmagic>if not defined npm_config_node_gyp (node "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
Traceback (most recent call last):
  File "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main
    return gyp_main(args)
  File "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 514, in gyp_main
    options.duplicate_basename_check)
  File "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 98, in Load
    generator.CalculateVariables(default_variables, params)
  File "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\generator\msvs.py", line 1916, in CalculateVariables
    generator_flags.get('msvs_version', 'auto'))
  File "C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion
    versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
KeyError: '2019'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\bakhil\AppData\Roaming\nvm\v10.15.1\node_modules\npm\node_modules\node-gyp\lib\configure.js:345:16)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bakhil\\AppData\\Roaming\\nvm\\v10.15.1\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\bakhil\source\repos\BOSS.Web\node_modules\mmmagic
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I tried a lot of solutions none work.

node version is 10.15.1

python version is 2.7.17

nvm running version is 1.1.7

Please help me to resolve this error. I am new to react-js

Thanks in advance

5
  • Does this answer your question? npm install that requires node-gyp fails on Windows Commented Aug 11, 2020 at 12:46
  • I will try once @Fcmam5 Commented Aug 11, 2020 at 13:11
  • npm ERR! [email protected] install: node-gyp rebuild still I am getting this error @Fcmam5 Commented Aug 11, 2020 at 14:24
  • Does this answer your question? Configure npm to find your python version Commented Aug 11, 2020 at 18:44
  • @MwamiTovi, Yeah I tried that solution too, but not working Commented Aug 12, 2020 at 10:06

1 Answer 1

2

Per newrelic, you can simply install newrelic with no optional dependencies.

npm install newrelic --no-optional

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.