首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >VSCode扩展-开始使用ksonnet

VSCode扩展-开始使用ksonnet
EN

Stack Overflow用户
提问于 2018-08-06 16:59:42
回答 1查看 2.4K关注 0票数 2

我真的很想尝试一下带有VSCode扩展的ksonnet,但是似乎无法正确地完成设置,我已经阅读了安装说明。

我做了以下工作:

  • brew install ks
  • brew install jsonnet
  • ks init traefik
  • git clone https://github.com/ksonnet/ksonnet-lib.git
  • 编辑vscode设置并将ksonnet-lib添加到设置中:"jsonnet.libPaths": ["/Users/kross/projects/gke/ksonnet-lib"],
  • 在新的vscode窗口中打开生成的traefik文件夹(不可取,但想知道根路径的分辨率)

以下是我所看到的错误:

代码语言:javascript
复制
RUNTIME ERROR: couldn't open import "base.libsonnet": no match locally or in the Jsonnet library paths.
Can't find path 'base.libsonnet'. If the file is not in the current directory, it may be necessary to add it to the 'jsonnet.libPaths'. If you are in vscode, you can press 'cmd/ctrl-,' and add the path this library is located at to the 'jsonnet.libPaths' array

注意:预览窗格适用于ks generate deployed-service文件,但预览窗格不适用于教程 redis实例(但ks show default工作):

代码语言:javascript
复制
Command failed: jsonnet -J /Users/kross/projects/gke/ksonnet-lib  --ext-code-file "__ksonnet/params"=/Users/kross/projects/gke/traefik/components/params.libsonnet --ext-code-file "__ksonnet/environments"=/Users/kross/projects/gke/traefik/environments/default/params.libsonnet /Users/kross/projects/gke/traefik/components/redis.jsonnet
RUNTIME ERROR: couldn't open import "k.libsonnet": no match locally or in the Jsonnet library paths.
/Users/kross/projects/gke/traefik/components/redis.jsonnet:4:11-31  thunk 
/Users/kross/projects/gke/traefik/components/redis.jsonnet:18:11    thunk 
std.jsonnet:1239:24 
std.jsonnet:1239:15-26  thunk 
std.jsonnet:1240:8  thunk 
std.jsonnet:1240:8-20   function 
std.jsonnet:1240:8-20   function 
/Users/kross/projects/gke/traefik/components/redis.jsonnet:(18:1)-(22:4)    

我一定是错过了一些非常基本的东西-这是什么?

EN

回答 1

Stack Overflow用户

发布于 2018-08-08 18:48:14

在使用VScode JSONNET扩展时,我也犯了类似的错误。见此处:https://github.com/heptio/vscode-jsonnet/issues/57

我能够通过修改User settings中的扩展设置来修复这个问题:

代码语言:javascript
复制
"jsonnet.libPaths": [
    "<my-home-dir-full-path>/go/src/github.com/ksonnet/ksonnet-lib/ksonnet.beta.3"
],

另外,请注意,目前官方的ksonnet VSCode扩展正在由ksonnet团队开发。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51712443

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档