我不小心删除了我的 packge.json 文件和节点模块

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

我不小心删除了我的 package.json 文件和 node 模块,现在我无法获取 json 文件,我已经更改了目录并重新开始,但它不起作用。enter image description here

我尝试删除 npm-cache 并尝试从新目录开始,但没有成功 我尝试过各种命令 rm -rf npm-cache, npm cache clean --force

node.js json node-modules npm-install npm-init
1个回答
0
投票

你必须尝试

npm init 

npm init -y

初始化您的项目,然后使用添加依赖项

npm install <package name>

填充您的

package.json
文件

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