1

I am getting below error while trying to execute below command

npm-check-updates

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

Error: Cannot find module '../../package.json' Require stack:

  • C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object. (C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js:11:40)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js'
    ]
    }

I see the location C:\Users\hbarsainya\AppData\Roaming\npm\node_modules\npm-check-updates\build\src\bin\cli.js exist. Can you help me solving this error?

1 Answer 1

0

I found the workaround in location https://github.com/raineorshine/npm-check-updates/issues/990

I changed "../../package.json" to "../../../package.json" in /home/ledsun/.local/share/nvm/v17.0.1/lib/node_modules/npm-check-updates/build/src/bin/cli.js:11, then the ncu runs expected.

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.