你好,我正在安装npm install
在我的laravel项目,但给我错误
npm ERR! code EJSONPARSE
npm ERR! path C:\xampp\htdocs\laravel_project/package.json
npm ERR! JSON.parse Unexpected token "}" (0x7D) in JSON at position 98 while parsing near "...: \"vite
build\",\n },\n \"devDependenc..."
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\my_PC\AppData\Local\npm-cache\_logs\2022-11-16T13_59_50_980Z-debug-0.log
PS C:\xampp\htdocs\laravel_project>
我已经尝试删除我的node_module中的package-lock.json
,并且已经执行了这些操作
npm cache clear --force
npm cache verify
这两种方法都会产生同样的错误
我使用的 composer 版本
Composer version 2.4.4 2022-10-27 14:39:29
我的npm版本
npm version 9.1.1
我的软件包. json
{
"private": true,
"scripts": {
"dev": "vite",
"build": "vite build",
},
"devDependencies": {
"@popperjs/core": "^2.10.2",
"@vitejs/plugin-vue": "^3.0.1",
"axios": "^1.1.2",
"bootstrap": "^5.2.1",
"laravel-vite-plugin": "^0.6.0",
"lodash": "^4.17.19",
"postcss": "^8.1.14",
"sass": "^1.32.11",
"vite": "^3.0.0",
"vue": "^3.2.37"
}
}
1条答案
按热度按时间qlzsbp2j1#
只需去掉
vite build
后面的逗号(,),问题就解决了。