如何解决 npm 错误:npm start 不起作用

发布于 2025-01-14 02:59:07 字数 645 浏览 4 评论 0原文

我正在尝试安装“npx create-react-app new”,它已成功安装,但是“npm start”显示错误:

PS D:\react project\new> npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\react project\new/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\react project\new\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2022-03-15T08_51_51_601Z-debug.log
PS D:\react project\new>

我检查了我的 package.json,它看起来很好,任何人都可以建议这里的问题是什么?

i am trying to install "npx create-react-app new" it successfully installs, however "npm start" shows error:

PS D:\react project\new> npm start
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\react project\new/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\react project\new\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2022-03-15T08_51_51_601Z-debug.log
PS D:\react project\new>

I checked my package.json, it looks fine, anyone can suggest whats the issue here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩发小公举 2025-01-21 02:59:07

首先运行:

npm run start

如果它不起作用,则删除节点模块文件夹并使用

npm i or npm install

它,它将为您工作。

First of all run:

npm run start

if it did not work then delete the node-module folder and use

npm i or npm install

this will work for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文