Giter Club home page Giter Club logo

Comments (6)

zchengo avatar zchengo commented on May 23, 2024

删除 node_modules 目录,重新 npm install 试试

from crm.

Micro-sheep avatar Micro-sheep commented on May 23, 2024

删除 node_modules 目录,重新 npm install 试试

删除了,还是没法运行。操作如下。

# sheep @ server in ~/crm/web on git:main x [11:00:26]
$ rm -rf node_modules

# sheep @ server in ~/crm/web on git:main x [11:00:30]
$

# sheep @ server in ~/crm/web on git:main x [11:00:31]
$ npm install

added 96 packages in 7s

# sheep @ server in ~/crm/web on git:main x [11:00:41]
$ npm run dev

> [email protected] dev
> vite

✘ [ERROR] Unexpected end of file in JSON

    ../../package.json:1:0:
      1 │
        ╵ ^

failed to load config from /home/sheep/crm/web/vite.config.js
error when starting dev server:
Error: Build failed with 1 error:
../../package.json:1:0: ERROR: Unexpected end of file in JSON
    at failureErrorWithLog (/home/sheep/crm/web/node_modules/esbuild/lib/main.js:1566:15)
    at /home/sheep/crm/web/node_modules/esbuild/lib/main.js:1024:28
    at runOnEndCallbacks (/home/sheep/crm/web/node_modules/esbuild/lib/main.js:1438:61)
    at buildResponseToResult (/home/sheep/crm/web/node_modules/esbuild/lib/main.js:1022:7)
    at /home/sheep/crm/web/node_modules/esbuild/lib/main.js:1134:14
    at responseCallbacks.<computed> (/home/sheep/crm/web/node_modules/esbuild/lib/main.js:671:9)
    at handleIncomingPacket (/home/sheep/crm/web/node_modules/esbuild/lib/main.js:726:9)
    at Socket.readFromStdout (/home/sheep/crm/web/node_modules/esbuild/lib/main.js:647:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)

from crm.

zchengo avatar zchengo commented on May 23, 2024

检查一下你的 node 版本,是不是 >= 18.12.0

from crm.

Micro-sheep avatar Micro-sheep commented on May 23, 2024

检查一下你的 node 版本,是不是 >= 18.12.0

node 版本是 19.2.0,按你说的换源也是会在 npm run dev 出错。

from crm.

zchengo avatar zchengo commented on May 23, 2024

还有一个办法就是,你 node 版本降到 18.12.0 ,我电脑用的 node 是这个版本的,执行 npm run dev 是没问题的

from crm.

Micro-sheep avatar Micro-sheep commented on May 23, 2024

还有一个办法就是,你 node 版本降到 18.12.0 ,我电脑用的 node 是这个版本的,执行 npm run dev 是没问题的

已解决,解决方法是把用户根目录下面的 package.json 删掉。

from crm.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.