question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Internal loader error in latest npm install

See original GitHub issue

version used: @redocly/openapi-cli@1.0.0-alpha.10 npm version: npm@6.14.5 Installation method: npm install -g @redocly/openapi-cli [as per README]

Error during validate:

$ openapi validate openapi.yaml 

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

Error: Cannot find module 'outdent'
Require stack:
- /usr/local/lib/node_modules/@redocly/openapi-cli/lib/redocly/index.js
- /usr/local/lib/node_modules/@redocly/openapi-cli/lib/rules/common/registry-dependencies.js
- /usr/local/lib/node_modules/@redocly/openapi-cli/lib/rules/oas3/index.js
- /usr/local/lib/node_modules/@redocly/openapi-cli/lib/rules/builtin.js
- /usr/local/lib/node_modules/@redocly/openapi-cli/lib/config/config.js
- /usr/local/lib/node_modules/@redocly/openapi-cli/lib/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1030:15)
    at Function.Module._load (internal/modules/cjs/loader.js:899:27)
    at Module.require (internal/modules/cjs/loader.js:1090:19)
    at require (internal/modules/cjs/helpers.js:75:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@redocly/openapi-cli/lib/redocly/index.js:18:19)
    at Module._compile (internal/modules/cjs/loader.js:1201:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1221:10)
    at Module.load (internal/modules/cjs/loader.js:1050:32)
    at Function.Module._load (internal/modules/cjs/loader.js:938:14)
    at Module.require (internal/modules/cjs/loader.js:1090:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/@redocly/openapi-cli/lib/redocly/index.js',
    '/usr/local/lib/node_modules/@redocly/openapi-cli/lib/rules/common/registry-dependencies.js',
    '/usr/local/lib/node_modules/@redocly/openapi-cli/lib/rules/oas3/index.js',
    '/usr/local/lib/node_modules/@redocly/openapi-cli/lib/rules/builtin.js',
    '/usr/local/lib/node_modules/@redocly/openapi-cli/lib/config/config.js',
    '/usr/local/lib/node_modules/@redocly/openapi-cli/lib/cli.js'
  ]
}

Could you please suggest a workaround or fix this ASAP??

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
benfdkingcommented, Jul 7, 2020

We have found a workaround for the time being with npx. Just specifying an older version:

npx @redocly/openapi-cli@0.12.16 help
0reactions
RomanHotsiycommented, Jul 7, 2020

Btw, the latest alpha.11 fixes the issue with outdent.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node:internal/modules/cjs/loader:942 throw err; ^ Error
You need to install express as the error is showing that express is missing. The command for that shall be npm install express...
Read more >
npm internal/modules/cjs/loader.js:883 throw err; ^ Error
Run This command: rm -rf node_modules package-lock.json && npm install && npm start but this command is also giving error 'rm' is not...
Read more >
Common errors
You are trying to install on a drive that either has no space, or has no permission to write. Free some disk space...
Read more >
ts-loader
TypeScript loader for webpack. Latest version: 9.4.2, last published: a month ago. Start using ts-loader in your project by running `npm i ...
Read more >
new-error
nodeDevHook [as .ts] (new-error/node_modules/ts-node-dev/lib/hook.js:61:7)\n' + ' at Module.load (internal/modules/cjs/loader.js:1002:32)\n' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found