当前位置:网站首页>ts 学习记录(一)sudo忘记密码(乌龙)Try changing the ‘lib’ compiler option to include ‘dom’.
ts 学习记录(一)sudo忘记密码(乌龙)Try changing the ‘lib’ compiler option to include ‘dom’.
2022-07-21 17:15:00 【人间清醒小仙女】
安装
真的很尴尬,一步一个坎
用的机器是mac 但是用不习惯导致一些问题
执行的时候npm包下载ts-node怎么都下不下来
使用sudo就可以了
sudo需要密码,找了半天都没找到怎么重新设置密码,最后试了一下电脑的锁屏密码
打开了
我真的会谢
创建
1.新建一个文件夹
2.用vscode打开
3.在文件夹下新建一个hello.ts的文件
4.安装ts以及ts-node
windows
npm install -g typescript
npm install -g ts-node
mac
sudo npm install -g typescript
sudo npm install -g ts-node
sudo有时候需要设置密码但是我老是不记得密码,错了三次,到处找怎么重置密码,最后试了一下是锁屏密码,我真的会谢我这个老六
执行
在ts文件中输入代码console.log(‘hello’)
因为node.js不能直接读取ts代码 需要转换成ts文件再进行读取,所以我们可以采取简化方式 , 安装ts-node包 使用方式:ts-node hello.ts
使用这个命令可能会报错:
TSError: ⨯ Unable to compile TypeScript:
hello.ts:1:1 - error TS2584: Cannot find name ‘console’. Do you need to change your target library? Try changing the ‘lib’ compiler option to include ‘dom’.
console.log(‘111’);
原因是:版本ts-node的版本太新了
使用 npm uni -g ts-node 卸载掉ts-node
再使用 npm i -g [email protected]下载旧一点的版本就不会了.
边栏推荐
- Error: L6200E: Symbol keyflag multiply defined (by main.o and key.o).
- 十年交易员重磅推荐:简单易操作的突破回调策略
- Self study golang [3.1 defining variables] use VaR keyword to define variables, use var() to define variables collectively, omit int keyword and VaR keyword, and use colon: to replace the definition
- Self study golang [3.7map exercise code]
- 马丁策略的几种应用
- 自学golang【3.7map的练习代码】
- 函数栈帧的形成和销毁(26张图助你深入理解函数栈帧)
- 【踩坑】npm安装报错解决办法
- Quantify three types of market in trading
- 序列化和反序列化
猜你喜欢
How to delete colored lines in Excel
Quantitative transaction journal - fallback analysis - February 6, 2021
Postman 配置全局变量 postman设置全局token
The foundation of writing notes in C language is not solid, and the earth is shaking
MySQL transaction
Update the version number and static resources (the storage address of the embedded web page)
软考中级【数据库系统工程师】第1章:计算机系统知识,自学软考笔记,备考2022年5月份软考,计算机硬件系统CPU组成指令寄存器组总线输入输出的程序控制方式计算机体系结构与存储系统加密技术流水线技术
量化交易中的三类行情
Verilog - 74lvc161 counter
It takes several years for a trading system to be a successful trading system, and how many years for a profit to be stable?
随机推荐
RPA是什么?推荐让电商运营10倍提效的自动化工具
Calculation of storage capacity and address space
Cloud security daily 220721: Cisco hybrid cloud operation and maintenance management solution found the vulnerability of executing arbitrary commands, which needs to be upgraded as soon as possible
Verilog application - 24 second basketball counter
Soft test intermediate [Database System Engineer] Chapter 0: how to prepare for the test by self-study, test introduction, test preparation materials, size score distribution in the morning and aftern
Collection and map summary
[C语言] 文件操作《一》
In quantitative trading, it is judged by the moving average system that the upward (downward) momentum is weakened
去除tinymce中粘贴的样式
P[0] as the judgment condition of the for loop
Redis' classic three questions and sentinel
Self study golang [3.3go language loop statement] for loop syntax structure, omit initial conditions, omit incremental conditions, omit the application of end conditions
Verilog - Basketball 24s timer
Différence entre les versions Runtime + compilateur et Runtime only
How does pytorch convert a variable or tensor to numpy?
指针总结篇
Is it safe for Galaxy Securities VIP to open an account with low commission? Is it a hoax?
Continuously improve cognition, so as to reach the highest level of trading - stable profits (I)
不断提升认知,从而达到交易的最高级别——稳定盈利(二)
C语言刷题笔记之基础不牢地动山摇 <一>