Error message: An error was encountered when running `npm run dev`
P粉031492081
P粉031492081 2023-08-16 19:40:59
0
1
593


C:UserssamyJobssahl_project>npm run dev

sahl_project@1.0.0 dev vite

X [ERROR] Expected a string in JSON, but found "<<" instead. ../package.json:2:0: 2 │ <<<<<<< HEAD ╵ ~~ Unable to load configuration file from C:UserssamyJobssahl_projectvite.config.js Error starting development server: Error: Build failed with 1 error: ../package.json:2:0: ERROR: Expected string in JSON, but found "<<" at failureErrorWithLog (C:UserssamyJobssahl_projectnode_modulesesbuildlibmain.js:1649:15) at C:UserssamyJobssahl_projectnode_modulesesbuildlibmain.js:1058:25 at runOnEndCallbacks (C:UserssamyJobssahl_projectnode_modulesesbuildlibmain.js:1484:45) at buildResponseToResult (C:UserssamyJobssahl_projectnode_modulesesbuildlibmain.js:1056:7) at C:UserssamyJobssahl_projectnode_modulesesbuildlibmain.js:1085:16 at responseCallbacks. (C:UserssamyJobssahl_projectnode_modulesesbuildlibmain.js:703:9) at handleIncomingPacket (C:UserssamyJobssahl_projectnode_modulesesbuildlibmain.js:762:9) at Socket.readFromStdout (C:UserssamyJobssahl_projectnode_modulesesbuildlibmain.js:679:7) at Socket.emit (node:events:513:28) at addChunk (node

:internal/streams/readable:324:12)

I tried deleting the package-lock.json and node_modules folders and executing npm install but it didn’t work .

P粉031492081
P粉031492081

reply all (1)
P粉533898694

It’s hard to pinpoint where exactly your problem is, but you can try a few things to fix it:

  1. Try usinggit diff --name-only --diff-filter=U --relativeto check for merge conflicts and list the files causing the problem.
  2. Before runningnpm run dev, try runningnpm ci.
  3. Try re-cloning the project in a different location and runnpm ion the master branch, then runnpm run devto see if the problem persists.
  4. Check that you are using the correct node version that is compatible with your projectnode -v.
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!