sencha app build错误代码生成,找不到json

2hh7jdfx  于 2022-09-26  发布在  其他
关注(0)|答案(5)|浏览(238)
C:\wamp\Sencha\Test>sencha app build testing
[ERR] Cannot find file: C:\Program Files\Sencha\Cmd\repo\.sencha\codegen.json
 at com.sencha.util.BasicFileSystemHelper.writeFileData(BasicFileSystemHelpe
r.java:49)
 at com.sencha.util.FileUtil.writeFileData(FileUtil.java:284)
 at com.sencha.util.FileUtil.writeFileData(FileUtil.java:266)
 at com.sencha.util.FileUtil.writeFile(FileUtil.java:246)
 at com.sencha.util.FileUtil.writeFile(FileUtil.java:238)
 at com.sencha.util.JsonUtil.saveJson(JsonUtil.java:145)
 at com.sencha.util.JsonUtil.saveJson(JsonUtil.java:149)
 at com.sencha.tools.generator.DataStoreImpl.save(DataStoreImpl.java:144)
 at com.sencha.tools.pkg.LocalRepository.init(LocalRepository.java:125)
 at com.sencha.tools.pkg.LocalRepository.init(LocalRepository.java:177)
 at com.sencha.command.environment.WorkspaceRepository.getLocalRepository(Wo
 rkspaceRepository.java:115)
 at com.sencha.command.environment.WorkspaceRepository.getCatalog(WorkspaceR
 epository.java:92)
 at com.sencha.command.environment.WorkspaceEnvironment.resolvePackageModels
 (WorkspaceEnvironment.java:103)
 at com.sencha.command.environment.WorkspaceEnvironment.resolvePackageEnviro
 nments(WorkspaceEnvironment.java:90)
 at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackag
 eEnvironments(AppOrPackageEnvironment.java:165)
 at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackag
 esNoThemes(AppOrPackageEnvironment.java:212)
 at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackag
 eNamesNoThemes(AppOrPackageEnvironment.java:203)
 at com.sencha.command.environment.AppEnvironment.<init>(AppEnvironment.java
 :66)
 at com.sencha.command.environment.BuildEnvironment.load(BuildEnvironment.ja
 va:193)
 at com.sencha.command.Sencha.loadBuildEnvironment(Sencha.java:374)
 at com.sencha.command.Sencha.main(Sencha.java:127)
 Caused by: C:\Program Files\Sencha\Cmd\repo\.sencha\codegen.json (The system
 cannot find the path specified)
 at java.io.FileOutputStream.open(Native Method)
 at java.io.FileOutputStream.<init>(Unknown Source)
 at com.sencha.util.BasicFileSystemHelper.writeFileData(BasicFileSystemHelpe
 r.java:41)
 at com.sencha.util.FileUtil.writeFileData(FileUtil.java:284)
 at com.sencha.util.FileUtil.writeFileData(FileUtil.java:266)
 at com.sencha.util.FileUtil.writeFile(FileUtil.java:246)
 at com.sencha.util.FileUtil.writeFile(FileUtil.java:238)
 at com.sencha.util.JsonUtil.saveJson(JsonUtil.java:145)
 at com.sencha.util.JsonUtil.saveJson(JsonUtil.java:149)
 at com.sencha.tools.generator.DataStoreImpl.save(DataStoreImpl.java:144)
 at com.sencha.tools.pkg.LocalRepository.init(LocalRepository.java:125)
 at com.sencha.tools.pkg.LocalRepository.init(LocalRepository.java:177)
 at com.sencha.command.environment.WorkspaceRepository.getLocalRepository(Wo
 rkspaceRepository.java:115)
 at com.sencha.command.environment.WorkspaceRepository.getCatalog(WorkspaceR
 epository.java:92)
 at com.sencha.command.environment.WorkspaceEnvironment.resolvePackageModels
 (WorkspaceEnvironment.java:103)
 at com.sencha.command.environment.WorkspaceEnvironment.resolvePackageEnviro
 nments(WorkspaceEnvironment.java:90)
 at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackag
 eEnvironments(AppOrPackageEnvironment.java:165)
 at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackag
 esNoThemes(AppOrPackageEnvironment.java:212)
 at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackag
 eNamesNoThemes(AppOrPackageEnvironment.java:203)
 at com.sencha.command.environment.AppEnvironment.<init>(AppEnvironment.java
 :66)
 at com.sencha.command.environment.BuildEnvironment.load(BuildEnvironment.ja
 va:193)
 at com.sencha.command.Sencha.loadBuildEnvironment(Sencha.java:374)
 at com.sencha.command.Sencha.main(Sencha.java:127)

我在构建应用程序测试时遇到此错误,我使用了sencha cmd和sencha 2.2版请回复解决方案
这是环境变量问题,在我的sencha命令设置C:\Program Files\sencha\cmd\repo.sencha\codegen中。json,repo文件夹不是在我的cmd设置文件夹中创建的,是否存在此问题??

cbwuti44

cbwuti441#

这是因为有在该目录中写入的权限。更改您的访问权限或在其他驱动器中安装sencha cmd。

kcrjzv8t

kcrjzv8t2#

以管理员身份运行cmd向我解决了问题!

qgzx9mmu

qgzx9mmu3#

在Windows 7下,当安装在Program Files/Program Files(x86)目录下时,安装Sencha cmd不会创建此“repo”目录。由于Windows 7不会授予此文件夹(及其子文件夹)的写入权限,因此cmd无法在其中创建任何内容。
首先,必须导航到安装文件夹c:\Program Files\Sencha\Cmd,并且必须在那里创建一个新文件夹“repo”(需要管理员权限)。
其次,必须更改“repo”文件夹的安全设置,并允许“完全访问”Users组。
从现在起,Sencha cmd工作正常。

kt06eoxx

kt06eoxx4#

我需要在sencha.cfg中配置已使用的目录,因为它被设置为错误的默认值:

repo.local.dir=/PATH/TO/DIR
biswetbf

biswetbf5#

我认为以下命令可能会为Linux用户以及使用GitBashWindows用户解决此问题,或者尝试在Powershell中解释类似的命令。

mkdir -p ~/.sencha/cmd
cat << EOF > $HOME/.sencha/cmd/sencha.cfg

# ------------------------------------------------------------------------------

# The folder for the local package repository. By default, this folder is shared

# by all versions of Sencha Cmd. In other words, upgrading Sencha Cmd does not

# affect the local repository.

repo.local.dir=${HOME}/.sencha/cmd/repo

EOF

sencha diag show

相关问题