Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error could not determine Node.js install directory

Tags:

node.js

npm

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
like image 291
Matoeil Avatar asked May 21 '26 02:05

Matoeil


2 Answers

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.
like image 139
Bodix Avatar answered May 28 '26 05:05

Bodix


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.

like image 45
Andrey Zhilyakov Avatar answered May 28 '26 05:05

Andrey Zhilyakov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!