简体   繁体   English

package.json 中没有许可证

[英]No license in package.json

I cloned a project from (...) / I am working on a node project.我从 (...) 克隆了一个项目/我正在处理一个节点项目。

When I run my code with the yarn I do the following command:当我用纱线运行我的代码时,我执行以下命令:

yarn start

However, it shows:但是,它显示:

yarn run v1.22.10

warning ..\package.json: No license field
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have tried uninstalling, removing, and updating yarn and npm, but I still have the same error.我已经尝试卸载、删除和更新 yarn 和 npm,但我仍然有同样的错误。

I also tried to manually update package.json but I still have the same error.我也尝试手动更新package.json但我仍然有同样的错误。

If package.json in the root folder of your project contains "license" field and you're still getting this warning.如果项目根文件夹中的package.json包含“许可证”字段,并且您仍然收到此警告。 That means there is another package.json that is this warning for.这意味着还有另一个package.json是针对此警告的。

As you can see the path of the JSON file is in the warning:如您所见,JSON 文件的路径在警告中:

warning ..\package.json: No license field

That double dots ..\ saying that the package.json file is one folder up where you are running your command.双点..\表示package.json文件是您运行命令的一个文件夹。 It could be OUTSIDE the project folder you're working on.它可能在您正在处理的项目文件夹之外。

So if you go one folder up you will find another package.json file.因此,如果您将 go 向上一个文件夹,您会发现另一个package.json文件。 Either add "license" field into it or simply delete the file if you do not need it.要么在其中添加“许可证”字段,要么在不需要时直接删除文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM