3

I inherited an application which works fine in node8, but npm install fails in node10, giving an error about fibers package being built using node-gyp

fibers is not a direct dependency of the app, so I want to know which dependency is bringing in fibers as it's dependency.

Unfortunately, npm ls, yarn why only works when node_modules is generated completely through npm install or yarn install. I did research online but couldn't find a static dependency tree generator just from package.json.

Even though I could just use node8 and run npm install followed by npm ls to figure out whose bringing in fibers; I believe there should be an easier static analysis of package.json.

Is there no way to statically analyze a package.json and create a dependency graph for it in npm/nodejs ?

I come from java and we had maven which can just analyze a file named pom.xml to create a nice graph about whats coming from where.

1 Answer 1

4
  1. Execute npm install in the directory and let it fail.
  2. It'll output something like A log of this can be found at <location>
  3. Open the log file and search for the text saveTree.
  4. Notice a hierarchy of resolved packages
  5. Here you can find the module you're looking for and whose bringing it in.
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.