2
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 5 years have passed since last update.

Cloud9インストール中の「Error: Cannot find module 'optimist'」の解決

Last updated at Posted at 2019-02-07

これは何?

この記事を参考にしてローカル環境へのCloud9インストール中に表題のエラーが発生した際の解決法メモ。

発生したエラー

$ node server.js
/mnt/c/Users/user_name/c9sdk/node_modules/c9/setup_paths.js:34
        throw e;
        ^

Error: Cannot find module 'optimist'
    at Module._resolveFilename (module.js:547:15)
    at Function.modules._resolveFilename (/mnt/c/Users/user_name/c9sdk/node_modules/c9/setup_paths.js:27:16)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at main (/mnt/c/Users/user_name/c9sdk/server.js:74:20)
    at Object.<anonymous> (/mnt/c/Users/user_name/c9sdk/server.js:55:5)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)

'optimist'がインストールされてないっぽい。

解決時の実行コマンド

$ npm install

npm入門によると、「パッケージの復元」の復元らしい。

解決しました

$ node server.js
Starting standalone
Connect server listening at http://127.0.0.1:8181
CDN: version standalone initialized /mnt/c/Users/user_name/c9sdk/build
Started '/mnt/c/Users/user_name/c9sdk/configs/standalone' with config 'standalone'!
Cloud9 is up and running
2
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
2
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?