danielgtaylor / aglio

An API Blueprint renderer with theme support that outputs static HTML
4.75k stars 480 forks source link

Error: Cannot find module 'protagonist' #293

Open MerlinFeng opened 7 years ago

MerlinFeng commented 7 years ago

module.js:327 throw err; ^

Error: Cannot find module 'protagonist' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/root/.nvm/versions/node/v4.5.0/lib/node_modules/.aglio_npminstall/node_modules/.2.2.1@aglio/lib/main.js:9:17) at Object. (/root/.nvm/versions/node/v4.5.0/lib/node_modules/.aglio_npminstall/node_modules/.2.2.1@aglio/lib/main.js:220:4) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12)

jdpnielsen commented 7 years ago

Your install might have failed while installing protagonist - try npm rebuild

pieterjandesmedt commented 7 years ago

Having the same error after installing aglio globally.

module.js:457
    throw err;
    ^

Error: Cannot find module 'protagonist'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/aglio/lib/main.js:9:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/aglio/lib/main.js:220:4)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)

Tried reinstalling protagonist globally and reinstalling python2. Tried npm rebuild. No joy. Maybe depending on Drafter instead of Protagonist would be the safer choice?

pieterjandesmedt commented 7 years ago

Rebuilding in the directory where aglio is installed did the trick. In my case

cd /usr/local/lib/node_modules/aglio/
npm i
npm rebuild