sematext / spm-agent-nodejs

NodeJS Monitoring Agent
https://sematext.com/integrations/nodejs-monitoring
Apache License 2.0
60 stars 6 forks source link

Cannot find module #13

Closed FrenchMajesty closed 7 years ago

FrenchMajesty commented 7 years ago

Hey,

I am using Meteor 1.5.2 on my application. I had installed this module and removed it, but my application crashes with the following error:

screen shot 2017-09-25 at 7 35 06 pm

I cannot trace back where this issue is coming from. I verified that all references to the module were removed but no success.

Thank you for you help.

otisg commented 7 years ago

How did you install it and how did you remove it? Please share details.

megastef commented 7 years ago

The reference comes from "-r" argument for the nodejs interpreter. Probably from an environment variable, which sets the relevant nodejs command line option:

export NODE_OPTIONS="-r spm-agent-nodejs“

In case you like to continue to use spm-agent-nodejs check following things:

Is spm-agent-nodejs listed in your package.json dependencies (installed with npm i spm-agent-nodejs --save)? Did you follow instructions from the blog post: https://sematext.com/blog/2017/03/13/meteorjs-monitoring-5-steps/ ?

The command npm root shows the location of node modules. The command npm root -g shows the location of global node modules.

Have you tried to use an absolute path to the module with the -r node options? Like node -r $(npm root)/spm-agent-nodejs app.js. Or a relative path like node -r ./spm-agent-nodejs

If you installed spm-agent-nodejs as global module (-g) node -r $(npm root -g)/spm-agent-nodejs app.js

megastef commented 7 years ago

@FrenchMajesty can we close this? - I don't think we have a bug here - it is related to the removed spm-agenent-nodejs module and not changing node command line options (remove '-r spm-agent-nodejs' from node cli options).

FrenchMajesty commented 7 years ago

@megastef Yes it was listed in my package.json and no I did not install it as global package.

I resolved this problem by creating a new meteor project, copy the file project and run a npm install.

megastef commented 7 years ago

@FrenchMajesty Thank you for the feedback.