RuntimeTools / appmetrics

Node Application Metrics provides a foundational infrastructure for collecting resource and performance monitoring data for Node.js-based applications.
https://developer.ibm.com/open/node-application-metrics/
Apache License 2.0
975 stars 126 forks source link

Unable to install appmetrics #638

Closed Janakiramkjr closed 4 years ago

Janakiramkjr commented 4 years ago

Hello All, I could able to install appmetrics on windows laptop. I am using the node V10.20.1 I am encountering the below error which attempting to install appmetrics

internal/modules/cjs/loader.js:807 return process.dlopen(module, path.toNamespacedPath(filename)); ^

Error: The specified procedure could not be found. \?\C:\Users\janaki\node_modules\appmetrics\appmetrics.node at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object. (C:\Users\F2531472\node_modules\appmetrics\index.js:44:15) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32)

Looking for your resolution. Can someone please guide if i am missing any.

mattcolegate commented 4 years ago

Hi @Janakiramkjr,

This looks like you haven't installed appmetrics. To do so, you either need to run npm install appmetrics in the directory where your Node.js application code is, or if you want to install globally (so all applications anywhere can use appmetrics) then run npm install -g appmetrics. If you have done this already can you tell me where your Node.js application is (directory), and if there were any errors encountered during npm installation.

Janakiramkjr commented 4 years ago

Hello Matt,

Thank you for the quick response. I have done in installation directory but still i could able to see the same error. C:\Program Files\nodejs>npm install -g appmetrics internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'appmetrics/start' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at Module._preloadModules (internal/modules/cjs/loader.js:901:12) at preloadModules (internal/bootstrap/node.js:602:7) at startup (internal/bootstrap/node.js:273:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'appmetrics/start' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at Module._preloadModules (internal/modules/cjs/loader.js:901:12) at preloadModules (internal/bootstrap/node.js:602:7) at startup (internal/bootstrap/node.js:273:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

mattcolegate commented 4 years ago

Hi @Janakiramkjr, Can you post the console output you got from npm install -g appmetrics please? Also can you post the lines in your Node.js code where you are requiring and setting up appmetrics please.

Janakiramkjr commented 4 years ago

Hello Matt,

Please find the below console output when i have install appmetrics

internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'appmetrics/start' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at Module._preloadModules (internal/modules/cjs/loader.js:901:12) at preloadModules (internal/bootstrap/node.js:602:7) at startup (internal/bootstrap/node.js:273:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'appmetrics/start' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at Module._preloadModules (internal/modules/cjs/loader.js:901:12) at preloadModules (internal/bootstrap/node.js:602:7) at startup (internal/bootstrap/node.js:273:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

I was trying start a service in IBM API Connect. Please do let me know if you need any information.

mattcolegate commented 4 years ago

Hi @Janakiramkjr,

I think the output above is what you get when you try to start your service. I would like the output obtained when you ran npm install -g appmetrics, to check to see if the installation went smoothly. I don't know anything about IBM API Connect, but if you can also send me anything about the service you are trying to start (like it's name, or maybe a documentation page on how to use it) that would assist me.

Janakiramkjr commented 4 years ago

Hello Matt, No this error is not related when i am starting the service, i am getting this error when i am trying to install appmetrics. Below is the link which i am following for creating a loopback service in API Connect. https://www.ibm.com/support/knowledgecenter/en/SSMNED_5.0.0/com.ibm.apic.toolkit.doc/tapim_cli_install.html Please let me know if you need more information.

mattcolegate commented 4 years ago

Hello @Janakiramkjr , So when you issued the command npm install -g appmetrics in an Administrator shell, you got the output about not being able to find appmetrics/start? And that's the whole output? I ask because I am expecting to see some native code compilation in the output of that command. The link above does not mention installing appmetrics, only apiconnect. I am not sure what you are trying to do.

Janakiramkjr commented 4 years ago

Hello Matt,

Yes you are right i am issuing a command npm install -g appmetrics in a command prompt (which i have opened as an administrator) i am getting the error. I dont know why it was referring to appmetrics.

Janakiramkjr commented 4 years ago

Hello Matt,

I have installed Node version v10.20.1 in my laptop. Do we have any issue with this version of node. Please advice.

mattcolegate commented 4 years ago

Hi @Janakiramkjr So here's what I get when I issue that command - this is the kind of output I'm expecting: npmAppmetricsInstall.txt

There are no known issues with appmetrics on Node.JS v10.21.1 (https://travis-ci.org/github/RuntimeTools/appmetrics/jobs/686469656)

Perhaps try running npm uninstall -g appmetrics to clean up what's there and then install again?

Janakiramkjr commented 4 years ago

Hello Matt,

Please find my log Microsoft Windows [Version 10.0.18363.778] (c) 2019 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>node -v v10.20.1

C:\WINDOWS\system32>npm install -g appmetrics internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'appmetrics/start' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at Module._preloadModules (internal/modules/cjs/loader.js:901:12) at preloadModules (internal/bootstrap/node.js:602:7) at startup (internal/bootstrap/node.js:273:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'appmetrics/start' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at Module._preloadModules (internal/modules/cjs/loader.js:901:12) at preloadModules (internal/bootstrap/node.js:602:7) at startup (internal/bootstrap/node.js:273:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

C:\WINDOWS\system32>

Even when i am trying to issue uninstall please console log C:\WINDOWS\system32>npm uninstall -g appmetrics internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'appmetrics/start' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at Module._preloadModules (internal/modules/cjs/loader.js:901:12) at preloadModules (internal/bootstrap/node.js:602:7) at startup (internal/bootstrap/node.js:273:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) internal/modules/cjs/loader.js:638 throw err; ^

Error: Cannot find module 'appmetrics/start' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at Module._preloadModules (internal/modules/cjs/loader.js:901:12) at preloadModules (internal/bootstrap/node.js:602:7) at startup (internal/bootstrap/node.js:273:9) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)

C:\WINDOWS\system32> I dont know what has happend. Do you want me to uninstall node and restart the laptop and install back the same node please advice.

mattcolegate commented 4 years ago

@Janakiramkjr Please try running npm uninstall -g appmetrics to clean up what's there and then install again. If that doesn't work, please try deleting C:\Users\<userName>\AppData\Roaming\npm\node_modules\appmetrics and then installing again. And if that doesn't work, delete it again, delete C:\WINDOWS\system32\node_modules if it exists, and try install again.

Janakiramkjr commented 4 years ago

Hello Matt, No luck. I followed the steps stated in your message but no luck. Something messed up. I have search node_modules in my C drive and i dont find any but still i dont know the reason why i am getting this error. Any inputs please

Janakiramkjr commented 4 years ago

Hello Matt, Found the issue. I have set the Node_Options in environment variable which is creating the issue. I have removed it and when i have issued the command it worked. I have to see whether i can start my service or not. Thank you for your prompt responses.

mattcolegate commented 4 years ago

Glad you finally got to the bottom of it @Janakiramkjr - I have to admit I was running out of ideas! If your problem is solved would you close this issue please?