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

compilation error when combined with certain packages #790

Closed
joniba opened this issue Jun 29, 2021 · 3 comments
Closed

compilation error when combined with certain packages #790

joniba opened this issue Jun 29, 2021 · 3 comments
Labels

Comments

@joniba
Copy link

joniba commented Jun 29, 2021

Description

Adding the newrelic package fails to compile when combined with certain packages in a certain order.

Steps to Reproduce

In empty directory run:

yarn add sqlite3
yarn add newrelic

Expected Behavior

I should not get any node-gyp compilation errors.

Actual Behavior

The last command outputs the following:

yarn add newrelic
yarn add v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
warning Error running install script for optional dependency: "C:\app\sources\test\node_modules\@newrelic\native-metrics: Command failed.
Exit code: 1
Command: node ./lib/pre-build.js install native_metrics
Arguments:
Directory: C:\app\sources\test\node_modules\@newrelic\native-metrics
Output:
============================================================================
Attempting install in native-metrics module. Please note that this is an
OPTIONAL dependency, and any resultant errors in this process will not
affect the general performance of the New Relic agent, but event loop and
garbage collection metrics will not be collected.
============================================================================

C:\Program Files\nodejs\node.exe C:\app\sources\test\node_modules\node-gyp\bin\node-gyp.js clean configure
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\JonathanBenAmi\.windows-build-tools\python27\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\app\\sources\\test\\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 'C:\\app\\sources\\test\\node_modules\\@newrelic\\native-metrics\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\app\\sources\\test\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\JonathanBenAmi\\.node-gyp\\14.17.1\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\JonathanBenAmi\\.node-gyp\\14.17.1',
gyp info spawn args '-Dnode_gyp_dir=C:\\app\\sources\\test\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\Users\\JonathanBenAmi\\.node-gyp\\14.17.1\\<(target_arch)\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\app\\sources\\test\\node_modules\\@newrelic\\native-metrics',
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:\\app\\sources\\test\\node_modules\\@newrelic\\native-metrics\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
C:\Program Files\nodejs\node.exe C:\app\sources\test\node_modules\node-gyp\bin\node-gyp.js build -j 4 native_metrics
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:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build/binding.sln',
gyp info spawn args '/t:native_metrics',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/p:Configuration=Release;Platform=x64',
gyp info spawn args '/m:4'
gyp info spawn args ]
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
gyp ERR! stack at onErrorNT (internal/child_process.js:467:16)
gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:82:21)
gyp ERR! System Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\app\\sources\\test\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "-j" "4" "native_metrics"
gyp ERR! cwd C:\app\sources\test\node_modules\@newrelic\native-metrics
gyp ERR! node -v v14.17.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! This is a bug in node-gyp.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! https://github.com/nodejs/node-gyp/issues
Failed to execute native-metrics install: No pre-built artifacts for your OS/architecture."

Your Environment

Node version: v4.17.1
OS: Windows 10 Pro

Additional notes

If you reverse the order of the commands (e.g., install sqlite3 AFTER newrelic), everything works fine

@bizob2828
Copy link
Member

bizob2828 commented Jul 1, 2021

@joniba thanks for bringing this to our attention. When you say

If you reverse the order of the commands (e.g., install sqlite3 AFTER newrelic), everything works fine

What are you observing that makes you believe everything is fine? It appears you may not have your environment properly setup to build native modules with node-gyp. We ship pre-built versions of native-metrics but only for linux architectures which is why you see this error at the end

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

The reason I think your environment isn't properly setup is because of this line

gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\15.0\Bin\MSBuild.exe ENOENT

Can you dig into this thread and see if it fixes your issue: MSBuild.exe ENOENT error w/ node-gyp

@michaelgoin
Copy link
Member

Hi @joniba ,

Just checking in on this one. Are you still having issues?

@michaelgoin
Copy link
Member

Closing this out as we cannot repro and looks to be a build issue.

If you are still having issues, we recommend leveraging our support team over at support.newrelic.com which can help deep-dive into solving the problem and collecting the necessary information which may or may not be sensitive (such as logs).

@bizob2828 bizob2828 moved this to Done: Issues recently completed in Node.js Engineering Board Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

3 participants