0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

#node command run script file – Error: Cannot find module '/not-exist-file.js' ( internal/modules/cjs/loader.js )

Last updated at Posted at 2020-05-05
  • 存在しないファイルを実行しようとした時に、このエラーが発生した
  • 実行ファイルを指定するとモジュール扱いになる?
  • あまり親切なメッセージで教えてくれたりはしないっぽい
$ node --version
v12.16.1

$ node /not-exist-file.js
internal/modules/cjs/loader.js:985
  throw err;
  ^

Error: Cannot find module '/not-exist-file.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?