ScreepsMods / screepsmod-mongo

Replace LokiJS with MongoDB and Redis
MIT License
24 stars 9 forks source link

Error after run npx screeps start #19

Closed HoPGoldy closed 5 years ago

HoPGoldy commented 5 years ago

I successfully installed screepmod-mongo. But a error occurred while executing npx screeps start, as following:

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, stat '/root/.npm/_npx/4679/lib/node_modules/screeps/node_modules/isolated-vm/.node-gyp/8.16.0'
gyp ERR! System Linux 4.15.0-54-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release" "-j" "4"
gyp ERR! cwd /root/.npm/_npx/4679/lib/node_modules/screeps/node_modules/isolated-vm
gyp ERR! node -v v8.16.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! isolated-vm@1.7.10 install: `node-gyp rebuild --release -j 4`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the isolated-vm@1.7.10 install 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/2019-07-30T01_45_59_317Z-debug.log
Install for screeps@latest failed with code 1

The following is a list of the versions I use.

application version
ubuntu 18.04
node 8.16.0
npm 6.4.1
screeps 3.4.3
screepsmod-mongo 2.5.5
mongodb 4.0.10
redis 5.0.5

The following is the output when the screepsmod-mongo is installed.

Screeps mod "screepsmod-mongo" has been successfully installed
+ screepsmod-mongo@2.5.5
added 15 packages from 10 contributors, removed 541 packages, updated 1 package and audited 183 packages in 85.481s
found 3 vulnerabilities (1 low, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details

My mongodb and redis are installed correctly, the addresses are mongodb://screeps-mongo and screeps-redis. I made the following configuration in .screepsrc:

[mongo]
host = mongodb://screeps-mongo

[redis]
host = screeps-redis

The following is in the mods.json:

"mods": [
  "node_modules/screepsmod-mongo/index.js"
]

How can I fix this problem?

HoPGoldy commented 5 years ago

I reinstalled mongodb to vestion 2.6.4 and redis to 3.0.6. But it still doesn't work with same error.

semperrabbit commented 5 years ago

did you validate the server worked before you installed mongo? it looks to be an IVM error, not an error in the mod...

HoPGoldy commented 5 years ago

It is normal before installing screepsmod-mogo:

Server version 3.4.3
Starting all processes. Ports: 21025 (game), 21026 (cli)
[storage] process 664 started
[backend] process 674 started
[engine_main] process 679 started
[engine_runner1] process 681 started
[engine_processor1] process 686 started
[engine_processor2] process 691 started
AlinaNova21 commented 5 years ago

Please look at the config options again, you are using the wrong format for mongo host. https://github.com/ScreepsMods/screepsmod-mongo#configuration

HoPGoldy commented 5 years ago

I solved the problem. Using this version 6.4.1 of npm installation will cause problems. Switching to yarn installation will not cause this problem.