LoginSignup
1
0

More than 5 years have passed since last update.

Node.js v9.4.0 > qiita_export_all v1.2.0使用時 > Error: Cannot find module 'mime/lite' の対処 > 本来はmimeはインストール済かもしれない

Last updated at Posted at 2018-10-03
動作環境
Ubuntu 16.04.3 LTS desktop amd64
tmux 2.1-3build1
Python 2.7.12
Python 3.5.2
Node.js v9.4.0

症状

@yumetodo さんのqiita_export_allのv1.1.0でこれまでQiitaのバックアップをしてきました。
( Qiita API v2 を使って自身の全投稿をエクスポートするJavascriptを書いた )

v1.2.0でコメント者名のJSON保存機能が実装されましたので、v1.2.0にして使おうとしました。

$ npm start

> qiita_export_all@1.2.0 start /home/XXX/QIITA_BACKUP_180111/qiita_export_all
> node bin/index.js

module.js:557
    throw err;
    ^

Error: Cannot find module 'mime/lite'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/yasokada/QIITA_BACKUP_180111/qiita_export_all/bin/image-manager.js:6:14)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! qiita_export_all@1.2.0 start: `node bin/index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the qiita_export_all@1.2.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

対処

mime/liteについては以下でインストール情報がありました。
https://stackoverflow.com/questions/32994407/error-cannot-find-module-mime

$npm install mime

npm startでv1.2.0のqiita_export_all が動くようになりました。

備考

(追記 2018-10-04)

コメント記載のとおり、別Ubuntu16.04LTS環境で再セットアップした場合、mimeは入っていました。

上記環境をどういうセットアップしたのか記録がありません。

1
0
7

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
1
0