3

I have tried to install ionic by doing npm install ionic

ionic start myapp blank does not work and since then any npm commands tells me :

$ npm config
node:internal/modules/cjs/loader:927
  throw err;
  ^

Error: Cannot find module 'C:\Users\dandonneau.m\devc\node_modules\npm\bin\npm-cli.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
Could not determine Node.js install directory
Matoeil
  • 6,851
  • 11
  • 54
  • 77

2 Answers2

5

I had the same error because I was using a too new version of Node for my system.

  • I have Windows 7.

  • The last officially tested version of Node on Windows 7 is 13.6.0 (source). Although, you can also try to run newer versions such as 15.8.0 (source).

  • The bug occurred when I tried to use Node version 17.1.0.

Solution

  1. I solved the problem by downgrading the Node version to 15.8.0 (in my case via nvm, you can just re-install).
  2. You can also try upgrading your operating system.
Bodix
  • 404
  • 5
  • 7
0

If you happen to install Node over already installed NVM, you might need to delete that installed Node version and re-install NVM (that helped in my case I executed a PowerShell script that installed Node over my NVM) here is the link to install the NVM for Windows.