gpt4 book ai didi

autorest - 引用 包括不在存储库中的源

转载 作者:行者123 更新时间:2023-12-02 01:05:06 24 4
gpt4 key购买 nike

我已经克隆了代码 for autorest.csharp它是子模块但是测试项目缺少依赖项

构建错误是

Error   CS0234  The type or namespace name 'Modeler' 
does not exist in the namespace 'AutoRest'
(are you missing an assembly reference?) autorest.csharp.test

但是解决方案文件包含以下内容

  <ItemGroup>
<Reference Include="autorest.modeler">
<HintPath>$(SolutionDir)\node_modules\@microsoft.azure\autorest.modeler\src\bin\netcoreapp2.0\autorest.modeler.dll</HintPath>
<!-- <HintPath>C:\work\oneautorest\autorest.modeler\src\bin\netcoreapp2.0\autorest.modeler.dll</HintPath> -->
</Reference>
<ProjectReference Include="$(SolutionDir)src/autorest.csharp.csproj" />
</ItemGroup>

如何包含缺失依赖项的代码(或者必要时包含 .dll)?

我可以看到建模器的来源位于 this repository但我应该如何访问它?

最佳答案

@microsoft.azure/autorest.modelerpackage.json devDependencies section 中声明.

That devDependencies部分描述为:

If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.

In this case, it's best to map these additional items in a devDependencies object.

These things will be installed when doing npm link or npm install from the root of a package, and can be managed like any other npm configuration param.

因此,根据您的情况,请尝试:

NODE_ENV=development npm install

对于 Windows:

cmd /v /c "set NODE_ENV=development&& npm install"

(不是 development&& 之间缺乏空间:这一点很重要)

为了获取并安装开发依赖项以及主要生产项目。

或者,如“npm install won't install devDependencies”中所述:

npm install --only=dev

另请检查 npm config 生产值是否设置为 true。如果该值为 true,它将跳过开发依赖项。

另外:运行npm config get production,确保将其设置为false:

npm config set -g production false

如果npm install --only=dev/npmrebuild不起作用,您可能需要删除node_modules package-lock.json 并再次运行 npm install

关于autorest - 引用 包括不在存储库中的源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50616173/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com