screepers / screeps-multimeter

The most useful tool on your screeps workbench.
MIT License
89 stars 28 forks source link

Cannot start #1

Closed ghost closed 7 years ago

ghost commented 7 years ago

{ Error: Cannot find module 'screeps-multimeter/plugins/alias' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at requireRelative (/home/user/.npm/lib/node_modules/screeps-multimeter/node_modules/require-relative/index.js:25:15) at _.each (/home/user/.npm/lib/node_modules/screeps-multimeter/src/multimeter.js:205:20) at arrayEach (/home/user/.npm/lib/node_modules/screeps-multimeter/node_modules/lodash/index.js:1289:13) at Function.<anonymous> (/home/user/.npm/lib/node_modules/screeps-multimeter/node_modules/lodash/index.js:3345:13) at Multimeter.loadPlugins (/home/user/.npm/lib/node_modules/screeps-multimeter/src/multimeter.js:204:7) at new Multimeter (/home/user/.npm/lib/node_modules/screeps-multimeter/src/multimeter.js:117:10) at Promise.resolve.then.then (/home/user/.npm/lib/node_modules/screeps-multimeter/bin/multimeter:13:15) code: 'MODULE_NOT_FOUND' }

CGamesPlay commented 7 years ago

This is strange. You've got multimeter installed globally, so you should be able to get at those modules normally. Not sure why require("screeps-multimeter/plugins/alias") is failing, in that case.

The fix for your issue is going to be something like this:

export NODE_PATH=/home/user/.npm/lib/node_modules
multimeter

If that does not fix it, please let me know what version of node/npm you're using.

node --version
npm --version
ghost commented 7 years ago

I fixed it by installing locally and calling this directly node_modules/screeps-multimeter/bin/multimeter.

Node: v6.9.2 Npm: 3.10.9

ghost commented 7 years ago

Perhaps using relative require rather than absolute require would fix it for others without having to modify NODE_PATH.