Error message: An error was encountered when running `npm run dev`
P粉031492081
2023-08-16 19:40:59
<p><br /></p>
<pre class="brush:php;toolbar:false;">C:UserssamyJobssahl_project>npm run dev</pre>
<blockquote>
<p>sahl_project@1.0.0 dev
vite</p>
</blockquote>
<pre class="brush:php;toolbar:false;">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.<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</pre>
<p>:internal/streams/readable:324:12)</p>
<p>I tried deleting the <code>package-lock.json</code> and <code>node_modules</code> folders and executing <code>npm install</code> but it didn’t work . </p>
It’s hard to pinpoint where exactly your problem is, but you can try a few things to fix it:
git diff --name-only --diff-filter=U --relative
to check for merge conflicts and list the files causing the problem.npm run dev
, try runningnpm ci
.npm i
on the master branch, then runnpm run dev
to see if the problem persists.node -v
.