-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
125 lines (86 loc) · 4.12 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
npm init -y
https://www.npmjs.com/package/yargs
npm i yargs@13.2.1 --save
```
node main.js --num 10
---------------
Executando o script a partir do diretório C:\primeiro-projeto
O fatorial de 6 é 720
O fatorial3 de 4 é 24
O fatorial2 de 5 é 120
O fatorial de 10 é 3628800
Arquivo test.txt salvo com sucesso.
script prestes a ser finalizado !
```
node main.js -n 10
---------------
Executando o script a partir do diretório C:\primeiro-projeto
O fatorial de 6 é 720
O fatorial3 de 4 é 24
O fatorial2 de 5 é 120
O fatorial de 10 é 3628800
Arquivo test.txt salvo com sucesso.
script prestes a ser finalizado !
```
npm i typescript -g
---------------
C:\Users\Felipe\AppData\Roaming\npm\tsserver -> C:\Users\Felipe\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
C:\Users\Felipe\AppData\Roaming\npm\tsc -> C:\Users\Felipe\AppData\Roaming\npm\node_modules\typescript\bin\tsc
+ typescript@3.3.3
updated 1 package in 4.885s
tsc --init
---------------
message TS6071: Successfully created a tsconfig.json file.
tsc
---------------
main.ts:2:58 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
2 console.log(`Executando o script a partir do diretório ${process.cwd()}`)
~~~~~~~
main.ts:5:12 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
5 const fs = require('fs')
~~~~~~~
main.ts:12:18 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
12 const fatorial = require('./fatorial') // primeiro na ordem de precedência (módulo com package.json)
~~~~~~~
main.ts:13:19 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
13 const fatorial3 = require('./fatorial3') // segundo
~~~~~~~
main.ts:14:19 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
14 const fatorial2 = require('./fatorial2') // terceiro e último
~~~~~~~
main.ts:22:14 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
22 const argv = require('yargs')
~~~~~~~
main.ts:31:13 - error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
31 console.log(module.paths) // [ 'C:\\primeiro-projeto\\node_modules', 'C:\\node_modules' ]
~~~~~~
main.ts:34:1 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
34 process.on('exit', () => {
~~~~~~~
Found 8 errors.
npm i @types/node --save-dev
---------------
npm WARN primeiro-projeto@1.0.0 No repository field.
+ @types/node@11.9.4
added 1 package from 35 contributors and audited 68 packages in 3.005s
found 0 vulnerabilities
npm i @types/yargs -D
---------------
npm WARN primeiro-projeto@1.0.0 No repository field.
+ @types/yargs@12.0.9
added 1 package from 6 contributors and audited 69 packages in 2.051s
found 0 vulnerabilities
tsc -w
---------------
[23:15:38] Starting compilation in watch mode...
[23:15:41] Found 0 errors. Watching for file changes.
node ./dist/main.js --num 10
---------------
Executando o script a partir do diretório C:\primeiro-projeto
O fatorial de 6 é 720
O fatorial de 10 é 3628800
[ 'C:\\primeiro-projeto\\dist\\node_modules',
'C:\\primeiro-projeto\\node_modules',
'C:\\node_modules' ]
Arquivo test.txt salvo com sucesso.
script prestes a ser finalizado !