Running npm run serve --open npm ERR! code ENOENT npm ERR! syscall open npm ERR! path D:\code-project\vue-dev\package.json npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, open 'D:\code-project\vue-dev\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! D:\Program Files\nodejs\node_global\_logs\2023-05-04T16_34_29_823Z-debug.log (node:14552) UnhandledPromiseRejectionWarning: Error: Command failed: npm run serve --open at makeError (D:\Program Files\nodejs\node_global\node_modules\@vue\cli\node_modules\execa\index.js:174:9) at D:\Program Files\nodejs\node_global\node_modules\@vue\cli\node_modules\execa\index.js:278:16 at processTicksAndRejections (internal/process/task_queues.js:93:5) at async runNpmScript (D:\Program Files\nodejs\node_global\node_modules\@vue\cli\lib\util\runNpmScript.js:17:10) (node:14552) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2) (node:14552) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
时间: 2023-06-12 15:02:55 浏览: 297
npm ERR! code EPERM npm ERR! syscall open npm ERR! path C:\Program Files\nodejs\node_cache\_cacache\
5星 · 资源好评率100%
这个错误信息显示,npm 找不到 package.json 文件,可能是你的项目目录不正确或者缺少了 package.json 文件。你可以检查一下项目目录是否正确,并且是否有 package.json 文件。如果没有,你可以通过运行 `npm init` 命令来创建一个新的 package.json 文件。另外,你也可以尝试重新安装 npm。
阅读全文