I had a working React
application built on NodeJS v20.17.0
. I have been using @mui/material
for some components successfully and wanted to add some icons to a Drawer component using @mui-icons-material
. When I ran $npm install @mui/material
, it took a while but seemed to install it correctly in my package.json
file, but not in my application repo’s node_modules
folder. I noticed that there is another folder from the original NodeJS install called node_modules outside of my repo directory. After installing @mui/material
without error, I tried to run $npm install
and $npm -v
and get the following error:
node:internal/modules/cjs/loader:1228
throw err;
^
Error: Cannot find module 'C:Scriptsnode_modulesnpmbinnpm-prefix.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
at Module._load (node:internal/modules/cjs/loader:1051:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.17.0
Could not determine Node.js install directory
What is happening here and how can I get @mui/icons-material
to install correctly? In searching it seems that this may be related to my Node version but I am not sure.
3