我剛剛創建了一個新的 vite 專案,執行 npm install 時出現以下錯誤。
節點.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
包.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"
}
}
uj5u.com熱心網友回復:
以管理員身份運行 cmd 解決了這個問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/506662.html
上一篇:安裝solcnpm的問題
