質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
FTP

FTP(File Transfer Protocol)は、ネットワークでのファイル転送を行うための通信プロトコルの1つである。

Atom(フォーマット)

Webサイトの見出しや要約などのメタデータを構造化して記述するXMLベースのフォーマット。

Q&A

解決済

1回答

819閲覧

AtomからFTP接続ができない

akoro

総合スコア27

FTP

FTP(File Transfer Protocol)は、ネットワークでのファイル転送を行うための通信プロトコルの1つである。

Atom(フォーマット)

Webサイトの見出しや要約などのメタデータを構造化して記述するXMLベースのフォーマット。

0グッド

0クリップ

投稿2019/02/01 05:46

編集2019/02/01 09:47

プログラミング初心者です。

AtomでFTP接続しようとしています。
.ftpconfigを編集し、connectを押したところで以下のエラーメッセージが出ました。

■エラー
unexpected token U in JSON at position 241
privatekeyの一行だけ赤くハイライトされている

■試したこと
syntax errorは以下で解消できるという記事を見たので試しに以下やりましたが駄目でした
C:\Users\~~を
・C:/Users/~~(\を/に変更)
・C:\Users\~~(\を二個にする)

プライベートキーのパスが純粋に間違えていないか、ほかの入力データにミスがないかも確認したので大丈夫だと思います。
そもそもエラーの意味も理解できないのですが、何が問題なのでしょうか?

お力添えいただけますと幸いです。

もし他に情報記載必要でしたら追記いたします。

--追記--

{ "protocol": "sftp", "host": "xxx.xx.xxx.xx", "port": 22, "user": "xxxx", "pass": "", "promptForPass": false, "remote": "/home/xxx/xx", "local": "", "agent": "", "privatekey": "C:\Users\xxx\xxx\xxx", "passphrase": "", "hosthash": "", "ignorehost": true, "connTimeout": 10000, "keepalive": 10000, "keyboardInteractive": false, "keyboardInteractiveForPass": false, "remoteCommand": "", "remoteShell": "", "watch": [], "watchTimeout": 500 }

error message:
Could not parse .fpconfig
Unexpected token U in JSON at position 241

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Stan_Dma

2019/02/01 05:54

You should show the contents of your .ftpconfig file as it is.
akoro

2019/02/01 06:02

Thank you for the advice, I added the contents. I just changed the parts to xxx which could be a part of personal info.
Stan_Dma

2019/02/01 06:06

Thank you. And your error message, please.
Stan_Dma

2019/02/01 06:08

I am afraid you have tried two Yen marks to specify directory separator, but your .ftpconfig do not. This is importat.
akoro

2019/02/01 06:26

I got error on the ones I wrote in the Q. Just in case I changed it to two yens, but I got syntax error back.
Stan_Dma

2019/02/01 06:51

Can you apply your input and output properly in your question, I mean reedit one please.
akoro

2019/02/01 06:58

do you mean two yen ver.?
Stan_Dma

2019/02/01 07:02

Yes, please. And I ask you another point, you have said in the question above that you got 'unexpected token ...' error, that is not syntax error. And you have commented you got syntax error. Those are the same or not? So more request. Could you show us the whole error messages ever you had?
akoro

2019/02/01 07:34

for the code above, I got this error. This is full message. Could not parse .fpconfig Unexpected token U in JSON at position 241
akoro

2019/02/01 07:45

this is the syntax error: Uncaught SyntaxError: Unexpected token u in JSON at position 0
Stan_Dma

2019/02/01 07:49 編集

Two errors? Which is what, where, when? Sorry I don't understand. I think everything should be (re)written on your question. I think there must be a mistake in the .ftpconfig description, especially the line of privatekey directive. Its value must have two yen marks for the directory separator. And the value must be the full path of your private key, like "C:\\foo\\bar\\mykey.ppk". The following site may help you: https://stackoverflow.com/questions/51152008/issue-connection-to-server-using-remote-ftp-atom-package-and-private-keys?rq=1
Stan_Dma

2019/02/01 07:58

I am afraid you may be misunderstanding the ftp configuration file as .fpconfig instead of .ftpconfig?
Stan_Dma

2019/02/01 09:30 編集

(moved to the answer)
guest

回答1

0

ベストアンサー

I have just used Atom for testing in my PC environment. I see what your error messeage "unexpected token U in JSON at position 241" means. The token 'U' means the first letter of 'Users' specified in 'C:\Users\xxx\xxx\xxx'. That shows you have not two yen marks before 'U' letter, you have only one yen mark. '\U' (U with single yen mark) processes specially to cause an error. And also 'position 241' points what the number of characters is counted by byte from the beginning of the .ftpconfig file. It means 241th character causes an error. Hope this help.

投稿2019/02/01 09:31

編集2019/02/01 09:52
Stan_Dma

総合スコア68

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

akoro

2019/02/01 09:48 編集

Thanks for the explanation of the error. I didin't even understand the meaning of it. So it means it shoukd work with C:\Users\xxx\xxx\xxx ?
akoro

2019/02/01 09:56 編集

sorry could you change the word to xxx? was a kind of personal info
Stan_Dma

2019/02/01 09:55

Yes. C:\Users\xxx\xxx\xxx if it is your private key file (usually with .ppk for its extension).
akoro

2019/02/01 09:58

Thanks for changing the word, and answer. I tried with two \ and got a new error message. ENOENT: no such file or directory, open 'C:\Users\xxx.ssh\config'
akoro

2019/02/01 10:00

I didn't type the path, I chose path the copy. which means the file should be existing but it says it doesn't. And,C:\Users\xxx.ssh\config this doesn't exist.
Stan_Dma

2019/02/01 10:13

I happened to get the same error too. I don't know well about Atom, but it seems to be a bug... A workaround is to copy .ftpconfig file to the C:\Users\xxx.ssh directory (create .ssh if not exists), and rename it to 'config'. It works for me.
akoro

2019/02/04 01:35

I didn't have .ssh directory so I tried to make one. Somehow the I cannot make the file .ssh. the error says make a proper name file.
Stan_Dma

2019/02/04 01:39 編集

You have to create 'config' file (renaming from .ftpconfig file) under the C:\Users\xxx.ssh directory, not '.ssh' file.
akoro

2019/02/04 01:43

made it! Connected. Thank you very much for your help.
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問