[英]Cannot create package.json no matter what I try
I have a react project and I'm having problems with trying to create package.json
file on the branch i'm on.我有一个反应项目,我在尝试在我所在的分支上创建
package.json
文件时遇到问题。 I have tried many of the top stack overflow answers in creating package.json
but nothing seems to work.我在创建
package.json
尝试了许多顶级堆栈溢出答案,但似乎没有任何效果。 This project was working fine last night and package.json
was there.这个项目昨晚运行良好,
package.json
就在那里。
When I run npm install
I get the following errors.当我运行
npm install
,出现以下错误。
npm install
npm WARN saveError ENOENT: no such file or directory, open
'/Users/wmannix/dev_repos/optic_link/integrator-ui/package.json'
npm WARN enoent ENOENT: no such file or directory, open
'/Users/wmannix/dev_repos/optic_link/integrator-ui/package.json'
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-
dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >=
3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN integrator-ui No description
npm WARN integrator-ui No repository field.
npm WARN integrator-ui No README data
npm WARN integrator-ui No license field.
I even tried running npm init -y
to create a new package.json
and I tried adding the configuration my self by pasting in the config from a package.json
I have in a react project on another branch but I ran into a number of problems with that as well including having to remove or stash package.json
and package-lock.json
every time I want to switch branch or pull the latest from the branch which never happened before.我什至尝试运行
npm init -y
来创建一个新的package.json
并且我尝试通过粘贴来自package.json
的配置来添加我自己的配置我在另一个分支的反应项目中但是我遇到了许多问题这也包括每次我想切换分支或从以前从未发生过的分支中提取最新版本时,必须删除或package-lock.json
package.json
和package-lock.json
。
git pull
Updating 73f82bc34..185bce04c
error: The following untracked working tree files would be overwritten by merge:
integrator-ui/package-lock.json
Please move or remove them before you merge.
Aborting
Any idea as to what is happening?知道发生了什么吗?
This is my file directory这是我的文件目录
When I do a git status, you can see my package-lock.json
file is in my Untracked files.当我执行 git status 时,您可以看到我的
package-lock.json
文件在我的 Untracked 文件中。 I pushed this react project up to Github and I thought it might be that the README
file and package.json
files might have been added to gitignore
but it doesn't seem to be the case.我将这个 react 项目推送到 Github,我认为可能是
README
文件和package.json
文件可能已添加到gitignore
但似乎并非如此。
If your local project is a copy of remote.如果您的本地项目是远程的副本。 Try this:
尝试这个:
git clone <your repo name>
npm init
npm init
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.