Typescript jupyter笔记本中的打字脚本

Typescript jupyter笔记本中的打字脚本,typescript,jupyter-notebook,Typescript,Jupyter Notebook,我正试图在jupyter笔记本上运行typescript 我尝试使用npm安装-g itypescript,但我得到的只是javascript内核 我正在使用anaconda,并且我已经安装了nodeJS。您可以通过Jupyter内核规范命令检查内核是否已注册到Jupyter $jupyter内核规范列表 可用内核: python3/home/yunabe/.local/share/jupyter/kernels/python3 typescript/home/yunabe/.local/sha

我正试图在jupyter笔记本上运行typescript

我尝试使用
npm安装-g itypescript
,但我得到的只是javascript内核


我正在使用anaconda,并且我已经安装了nodeJS。

您可以通过
Jupyter内核规范
命令检查内核是否已注册到Jupyter

$jupyter内核规范列表
可用内核:
python3/home/yunabe/.local/share/jupyter/kernels/python3
typescript/home/yunabe/.local/share/jupyter/kernels/typescript
如果此处未列出
typescript
,则在安装内核时由于某种原因未能注册内核

另一个类型脚本内核 即使您可以正确安装
itypescript
内核,您也可能会发现内核在您的用例中不是很有用,因为它不允许您通过设计重新定义具有相同名称的变量。如果执行
函数f(){}
,您只会收到一条错误消息,如
TS2393:replicate function implementation.

如果您认为
itypescript
不适合您的用例,请尝试使用我最近实现的新内核:


它的设计和实现与
itypescript
不同,它可能非常适合您的用例。

您可以通过
Jupyter kernel spec
命令检查内核是否已注册到Jupyter

$jupyter内核规范列表
可用内核:
python3/home/yunabe/.local/share/jupyter/kernels/python3
typescript/home/yunabe/.local/share/jupyter/kernels/typescript
如果此处未列出
typescript
,则在安装内核时由于某种原因未能注册内核

另一个类型脚本内核 即使您可以正确安装
itypescript
内核,您也可能会发现内核在您的用例中不是很有用,因为它不允许您通过设计重新定义具有相同名称的变量。如果执行
函数f(){}
,您只会收到一条错误消息,如
TS2393:replicate function implementation.

如果您认为
itypescript
不适合您的用例,请尝试使用我最近实现的新内核:


它的设计和实现与
itypescript
不同,它可能非常适合您的用例。

除了安装TypeScript npm包之外:

npm install -g typescript
您还需要安装内核。以下内容将全局安装它:

its --install=global

在这两种情况下,除了安装TypeScript npm软件包外,您可能还需要使用sudo。

npm install -g typescript
您还需要安装内核。以下内容将全局安装它:

its --install=global

在这两种情况下,您可能都需要使用sudo。

您能发送错误消息吗?@PrzemyslawPietrzak没有真正的错误,只是无法识别类型语法。内核的名称是“javascript(node.js)”你能发送错误消息吗?@PrzemyslawPietrzak没有真正的错误,它只是不能识别类型语法。内核的名称是“javascript(node.js)”