Home > Enterprise >  Using Node 18 but 'npm install prisma' is throwing a Node version error
Using Node 18 but 'npm install prisma' is throwing a Node version error

Time:11-13

I am getting the following error when I try 'npm install prisma'

npm ERR! code 1
npm ERR! path /Users/path/to/project/node_modules/prisma
npm ERR! command failed
npm ERR! command sh -c -- node scripts/preinstall-entry.js
npm ERR! ┌───────────────────────────────────────────┐
npm ERR! │   Prisma only supports Node.js >= 14.17   │
npm ERR! └───────────────────────────────────────────┘

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/me/.npm/_logs/2022-11-09T20_20_18_706Z-debug-0.log

I am using Node 18 which I installed through nvm on Mac OS.

$ node --version
v18.12.1
$ nvm version
v18.12.1

I tried using pnpm, deleting and reinstalling nvm, and removing all other node versions, or downgrading to 16, or 18.8.0, but none of these worked. Is this a known error? Can someone help me figure out the issue?

CodePudding user response:

Try remove others Node version which installed by others method such as using .pkg or home-brew, because I think your OS is not using Node version that nvm installed.

To make sure you removed all Node versions completely from your OS, run:

node --version
-bash: node: command not found

Then reinstall Node with nvm again.

Hope it help!

CodePudding user response:

Turns out, there was an old node_modules/node directory in my home (~) directory. I deleted it and that fixed the issue.

  • Related