uribo / textlintr

✅ Natural Language Linter Tools for 'R Markdown' and R Code 💯
https://uribo.github.io/textlintr/
Other
8 stars 1 forks source link

Error: '#193 %1 is not a valid Win32 application' on Appveyor #5

Closed uribo closed 5 years ago

uribo commented 5 years ago

Appveyor上のテストでinit_textlintr() を実行すると次のエラーになる。

https://ci.appveyor.com/project/uribo/textlintr/build/1.0.10#L441

権限周りのエラーのようで、今の所解決策がわからない。

niszet commented 5 years ago

Windows環境で使用しているので挙動のご報告。 init_textlintr()を実行してもエラーにはなりませんが、インストールはされずにtextlint()実行時に下記のようにエラーになります。こちらでも調べてみます。

textlintr::init_textlintr()
textlint(lint_target)
## Error in process_initialize(self, private, command, args, stdin, stdout,  : 
##   Command not found
niszet commented 5 years ago

上記の挙動ですが、どうもglobalのnpmパッケージとしてtextlintを私がインストールしていたためらしく、一旦npm uninstall textlint -gしたところ、

textlintr::init_textlintr()
Yeah! Install was successful

とインストールでき、無事に

 Error in process_initialize(self, private, command, args, stdin, stdout,  : 
  processx error, create process: #193 %1 は有効な Win32 アプリケーションではありません。
 at 'win/processx.c:1039' 

が再現できました。確認していきます。

uribo commented 5 years ago

報告ありがとうございます。

はい、現在の仕様ではinit_textlintr() の実行で .textlintr/ ディレクトリの中にpackage.jsonを作成し、そこでnpm install を行うようになっています(textlintおよびルール用のファイルがインストールされます)。

READMEの情報が誤っていますね。すみません、訂正しておきます (#12)。

niszet commented 5 years ago

globalの方にインストールしていても、is_installed_dependencies("textlint")TRUEを返しているようなので、.textlintr/に依存するコードがあるとそこでエラーになる…かも?今のところ問題ないですが。

本件、下記のエラーメッセージと同じなのですが、現象的にはちょっと違いそう…。実行pathには空白文字は入っていないので…。 https://support.microsoft.com/en-us/help/812486/event-id-7000-and-1-is-not-a-valid-win32-application-error-message-whe

こちらの、executableではない云々の方が気になりますね。 http://forums.codeguru.com/showthread.php?532247-error-193-with-CreateProcess-why

.js自体はwin上では単体では実行できない気がするので…もう少し調べてみます。

uribo commented 5 years ago

Sys.which("textlint") の結果はどうなりますか?

niszet commented 5 years ago

こんな感じです。おや…?調べてみます。

> Sys.which("textlint")
textlint 
      "" 
uribo commented 5 years ago

ありがとうございます。一度textlintはアンインストールされているのですよね (https://github.com/uribo/textlintr/issues/5#issuecomment-428950894)

エラー処理が不十分で、init_textlintr()で正常終了してもnpm installが成功していない可能性があります。

https://github.com/uribo/textlintr/blob/2e61001b32ff0088daf79a6c9edfd0bea3ca9a0b/R/textlintrc.R#L40-L47

uribo commented 5 years ago

こちらの問題はこのissueと違うと思うので、 続きは #15 で議論しましょう :)