无法安装npm,错误!错误号-4058

问题描述 投票:0回答:2

我想学习 cypress,并开始在这里逐步学习 cypress 教程。但是当开始: npm install 然后出现了这样一个疯狂的错误:

$ npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\Kamil\Desktop\Kurs/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\Kamil\Desktop\Kurs\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\Kamil\AppData\Local\npm-cache\_logs\2023-09-19T20_43_21_108Z-debug-0.log

我做了什么:

  1. 我运行:npm install -g nodemon
  2. 删除:包锁 但还是有问题

我需要这个来继续柏树课程

node.js cypress npm-install
2个回答
0
投票

您可能位于错误的文件夹中,或者您可能不小心删除了

package.json

您必须从存在

npm install
的文件夹运行
package.json


0
投票

执行

npm init
并填写详细信息,或者执行
npm init -y
确保您位于正确的目录中)。

© www.soinside.com 2019 - 2024. All rights reserved.