質問編集履歴
3
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
linuxとubuntuを搭載したpcはwindowsでやるべきでしょうか。
|
body
CHANGED
@@ -1,49 +1,1 @@
|
|
1
|
-
dockerでexpress / mysql / typeormの環境を構築しましたが、
|
2
|
-
|
1
|
+
ubuntu搭載pcを買うか、windowsやmacを買って仮想環境でlinuxを動かすかどちらがいいのでしょうか。
|
3
|
-
dockerのproxyかなと思い、.zshrcファイルにno_proxy="127.0.0.1,localhost"を設定しましたが変わらずでした。
|
4
|
-
typeormの設定をコメントアウトしてserverを起動するとエラーが出ずに起動できました。
|
5
|
-
原因を教えていただけないでしょうか。
|
6
|
-
バージョンやエラー詳細は下記になります。
|
7
|
-
|
8
|
-
mac catalina: 10.15.3
|
9
|
-
docker: Docker version 20.10.0
|
10
|
-
|
11
|
-
```
|
12
|
-
Error: Connection lost: The server closed the connection.
|
13
|
-
at Protocol.end (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/mysql/lib/protocol/Protocol.js:112:13)
|
14
|
-
at Socket.<anonymous> (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/mysql/lib/Connection.js:94:28)
|
15
|
-
at Socket.<anonymous> (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/mysql/lib/Connection.js:526:10)
|
16
|
-
at Socket.emit (events.js:327:22)
|
17
|
-
at Socket.EventEmitter.emit (domain.js:486:12)
|
18
|
-
at endReadableNT (_stream_readable.js:1327:12)
|
19
|
-
at processTicksAndRejections (internal/process/task_queues.js:80:21)
|
20
|
-
--------------------
|
21
|
-
at Protocol._enqueue (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/mysql/lib/protocol/Protocol.js:144:48)
|
22
|
-
at Protocol.handshake (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/mysql/lib/protocol/Protocol.js:51:23)
|
23
|
-
at PoolConnection.connect (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/mysql/lib/Connection.js:116:18)
|
24
|
-
at Pool.getConnection (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/mysql/lib/Pool.js:48:16)
|
25
|
-
at /Users/hoge-mbp-xxx/Documents/sample_init/src/driver/mysql/MysqlDriver.ts:894:18
|
26
|
-
at new Promise (<anonymous>)
|
27
|
-
at MysqlDriver.createPool (/Users/hoge-mbp-xxx/Documents/sample_init/src/driver/mysql/MysqlDriver.ts:891:16)
|
28
|
-
at MysqlDriver.<anonymous> (/Users/hoge-mbp-xxx/Documents/sample_init/src/driver/mysql/MysqlDriver.ts:344:36)
|
29
|
-
at step (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/tslib/tslib.js:141:27)
|
30
|
-
at Object.next (/Users/hoge-mbp-xxx/Documents/sample_init/node_modules/tslib/tslib.js:122:57) {
|
31
|
-
fatal: true,
|
32
|
-
code: 'PROTOCOL_CONNECTION_LOST'
|
33
|
-
}
|
34
|
-
hoge-mbp-xxx@HOGEnoMacBook-Pro sample_init % npx ts-node ./node_modules/.bin/typeorm migration:generate -n user
|
35
|
-
```
|
36
|
-
|
37
|
-
```
|
38
|
-
export const app = (async () => {
|
39
|
-
// コメントアウトでエラー消える箇所
|
40
|
-
const connection = await createConnection(env).catch((err) =>
|
41
|
-
console.error(err)
|
42
|
-
);
|
43
|
-
const app = express();
|
44
|
-
app.use(cors());
|
45
|
-
app.use(bodyParser.json());
|
46
|
-
app.use("/hoge", router);
|
47
|
-
return app;
|
48
|
-
})();
|
49
|
-
```
|
2
修正
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
typeormのmigrationで出るError: Connection lost: The server closed the connection.の解決方法
|
body
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
dockerでexpress
|
1
|
+
dockerでexpress / mysql / typeormの環境を構築しましたが、
|
2
|
-
typeormでmigrationをする際
|
2
|
+
typeormでmigrationをする際に、掲題のエラーが表示されてしまいmigrationができません。
|
3
|
-
dockerのproxyかなと思い、.zshrcファイルにno_proxy="127.0.0.1,localhost"
|
3
|
+
dockerのproxyかなと思い、.zshrcファイルにno_proxy="127.0.0.1,localhost"を設定しましたが変わらずでした。
|
4
|
-
typeormの設定をコメントアウトしてserverを
|
4
|
+
typeormの設定をコメントアウトしてserverを起動するとエラーが出ずに起動できました。
|
5
|
-
|
5
|
+
原因を教えていただけないでしょうか。
|
6
|
-
|
7
6
|
バージョンやエラー詳細は下記になります。
|
8
7
|
|
9
8
|
mac catalina: 10.15.3
|
1
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
バージョンやエラー詳細は下記になります。
|
8
8
|
|
9
9
|
mac catalina: 10.15.3
|
10
|
-
docker: Docker version 20.10.0
|
10
|
+
docker: Docker version 20.10.0
|
11
11
|
|
12
12
|
```
|
13
13
|
Error: Connection lost: The server closed the connection.
|