olistic / warriorjs

🏰 An exciting game of programming and Artificial Intelligence
https://warriorjs.com
MIT License
9.43k stars 490 forks source link

Crashes after reporting no warriorjs directory found. #85

Closed Rbagman closed 6 years ago

Rbagman commented 6 years ago

Environment

System: Host: hostname Kernel: 4.10.5-antix.1-486-smp i686 bits: 32 gcc: 6.3.0 Desktop: IceWM 1.4.2 Distro: antiX-17_386-base Heather Heyer 24 October 2017

$ npx envinfo --system --binaries --npmPackages warriorjs --npmGlobalPackages warriorjs --markdown

npx: installed 1 in 3.202s (node:22914) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'devDependencies' of null at Promise.all.i.getPackageJsonByPath.then.e (/home/username/.npm/_npx/22914/lib/node_modules/envinfo/dist/cli.js:2:72540) at (node:22914) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:22914) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Steps to reproduce

? No warriorjs directory found, would you like to create one? Yes (node:21463) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/@warriorjs/cli/bin/warriorjs' (node:21463) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:21463) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected Behavior

Character roll/creation

Actual Behavior

No fun.

olistic commented 6 years ago

Hello @Rbagman, thanks for your interest in the project! Looking at the output of mkdir, it seems that you don't have permissions to create a directory on the directory under which you're running warriorjs. Try changing the directory before running warriorjs or passing the -d option. If that doesn't solve the issue, I'd need more info from you:

$ node --version
$ npm --version

(The npx command is not collecting everything for some reason.)

Rbagman commented 6 years ago

I just looked at it. I think I su'd before running the script. I tried su again and no error. I'll try reinstalling.