node.jsjsontypescriptnpmyarnpkg

Inquirer Not Installing In Nodejs


I Am making A Calculator With Typescript/JavaScrip and I immediately encountered this error.

PS C:\Users\RanaG\Desktop\TS Projects\project00_calculator\tsconfig.json-master\tsconfig.json-master\src> npm start               
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> tsconfig.json@1.0.7 start
> node src/index.js

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module './internal/Observable'
Require stack:
- C:\Users\RanaG\Desktop\TS Projects\project00_calculator\tsconfig.json-master\tsconfig.json-master\node_modules\rxjs\index.js    
- C:\Users\RanaG\Desktop\TS Projects\project00_calculator\tsconfig.json-master\tsconfig.json-master\node_modules\inquirer\lib\ui\prompt.js
- C:\Users\RanaG\Desktop\TS Projects\project00_calculator\tsconfig.json-master\tsconfig.json-master\node_modules\inquirer\lib\inquirer.js
- C:\Users\RanaG\Desktop\TS Projects\project00_calculator\tsconfig.json-master\tsconfig.json-master\src\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\RanaG\Desktop\TS Projects\project00_calculator\tsconfig.json-master\tsconfig.json-master\node_modules\rxjs\index.js:3:20)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\RanaG\\Desktop\\TS Projects\\project00_calculator\\tsconfig.json-master\\tsconfig.json-master\\node_modules\\rxjs\\index.js',
    'C:\\Users\\RanaG\\Desktop\\TS Projects\\project00_calculator\\tsconfig.json-master\\tsconfig.json-master\\node_modules\\inquirer\\lib\\ui\\prompt.js',
    'C:\\Users\\RanaG\\Desktop\\TS Projects\\project00_calculator\\tsconfig.json-master\\tsconfig.json-master\\node_modules\\inquirer\\lib\\inquirer.js',
    'C:\\Users\\RanaG\\Desktop\\TS Projects\\project00_calculator\\tsconfig.json-master\\tsconfig.json-master\\src\\index.js'     
  ]
}
PS C:\Users\RanaG\Desktop\TS Projects\project00_calculator\tsconfig.json-master\tsconfig.json-master\src>

I also got this error

PS C:\Users\RanaG\Desktop\TS Projects\project00_calculator\tsconfig.json-master\tsconfig.json-master\src> npm install inquirer
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

changed 40 packages, and audited 599 packages in 1m

40 packages are looking for funding

40 packages are looking for funding
  run `npm fund` for details

13 vulnerabilities (1 moderate, 9 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

I tried a GitHub Repository but this didn't fix it.


Solution

  • try running npm install rxjs first which is a dependency for observable. Also, would highly suggest you reformat the question because I got dizzy trying to go through with all the decorations.