Cannot find module '/home/yohei/.nvm/versions/node/v9.10.1/lib/node_modules/yo/node_modules/spawn-sync/postinstall てでたとき
npm install --global yo
できなかった。
ログはこんな感じ
module.js:478 throw err; ^ Error: Cannot find module '〜/.nvm/versions/node/v9.10.1/lib/node_modules/yo/node_modules/spawn-sync/postinstall' at Function.Module._resolveFilename (module.js:476:15) at Function.Module._load (module.js:424:25) at Module.runMain (module.js:611:10) at run (bootstrap_node.js:387:7) at startup (bootstrap_node.js:153:9) at bootstrap_node.js:500:3 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! spawn-sync@1.0.15 postinstall: `node postinstall` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the spawn-sync@1.0.15 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2018-04-25T14_16_41_992Z-debug.log
なんやておもってググった。
どうやら
てことでserverlessというモジュールだったのでYOに変えた。
npm install -g try-thread-sleep npm install -g yo --ignore-scripts spawn-sync
これでなんかしらんがインストールできた。
調べてみるとspawn-syncのエラーらしい。その内なおることを期待しとこう。