skip to Main Content
C:UserssamyJobssahl_project>npm run dev

[email protected] dev
vite

X [ERROR] Expected string in JSON but found "<<"

../package.json:2:0:
  2 │ <<<<<<< HEAD
    ╵ ~~

failed to load config from C:UserssamyJobssahl_projectvite.config.js
error when starting dev 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.<computed> (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 to delete package-lock.json and the node_modules folder and do npm install, but that does not work.

2

Answers


  1. You have git conflicts in your package.json file. You should resolve them (and any other git conflicts) before trying to do anything else.

    Note

    You can run git diff --check to help find offending git files

    Login or Signup to reply.
  2. It’s tricky to say where exactly is the problem from your question but you could try some of these ways to solve the problem,

    1. Try to check for merge conflicts by using git diff --name-only --diff-filter=U --relative to list out the files causing the problem.
    2. Try running npm ci before you run npm run dev
    3. Try to freshly clone the project in a different location & run npm i on the master & then npm run dev to see if the problem persists.
    4. Check if you’re using the right node version node -v compatible for your project.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search