Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install throwing expected "0.15.7" but got "" on new vite project

I just created a new vite project and i am getting the following error when executing npm install.

node.js: 16.17.0

npm: 8.15.0

npm ERR! C:\xxx\GIT\NewTestProject\node_modules\esbuild\install.js:93
npm ERR!     throw new Error(`Expected ${JSON.stringify("0.15.7")} but got ${JSON.stringify(stdout)}`);
npm ERR! C:\xxx\GIT\NewTestProject\node_modules\esbuild\install.js:93
npm ERR!
npm ERR! Error: Expected "0.15.7" but got ""
npm ERR!     at validateBinaryVersion (C:\xxx\GIT\NewTestProject\node_modules\esbuild\install.js:93:11)
npm ERR!     at C:\xxx\GIT\NewTestProject\node_modules\esbuild\install.js:240:5

package.json

{
  "name": "newtestproject",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "vue": "^3.2.37"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^3.1.0",
    "vite": "^3.1.0"
  }
}
like image 476
MrSpt Avatar asked Nov 29 '25 09:11

MrSpt


1 Answers

To solve the problem, I uninstalled some dependencies and re-installed their latest versions until eventually I ran npm update and that solved it.

like image 107
Hebron Watson Avatar answered Nov 30 '25 23:11

Hebron Watson