olistic / warriorjs

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

Re: No warriorjs directory found, would you like to create one? #88

Closed Rbagman closed 6 years ago

Rbagman commented 6 years ago

I just tried reinstalling as a regular user and I don't have permission to access that file. If I su the game runs as reported on your getting started page.

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs npm install --global @warriorjs/cli

I checked to see if it was installed elsewhere.

sudo find / -iname "warriorjs" /usr/lib/node_modules/@warriorjs/cli/bin/warriorjs /usr/bin/warriorjs

cd /usr/bin/warriorsjs bash: cd: /usr/bin/warriorsjs: No such file or directory

$ cd /usr/lib/node_modules/@warriorjs/cli/bin/warriorjs/ $: /usr/lib/node_modules/@warriorjs/cli/bin/warriorjs $: warriorjs Welcome to WarriorJS ? No warriorjs directory found, would you like to create one? Yes (node:5527) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/@warriorjs/cli/bin/warriorjs/warriorjs' (node:5527) 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:5527) [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. $ :/usr/lib/node_modules/@warriorjs/cli/bin/warriorjs

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.

olistic commented 6 years ago

Hello @Rbagman, it looks like you're running the game from the directory the binary is located at, and that won't work. Can you please try the following in a terminal session?

# Go to your home directory, presumably:
cd ~
# Let's check if `warriorjs` is in your PATH:
which warriorjs

If that returns the path to the binary, just run it by executing warriorjs from your home.

If that fails, I would need the output of:

Thanks!

antony commented 6 years ago

I recommend using nvm to manage your node installation, meaning you don't need to do anything as root (or with sudo), and your installed binaries will be automatically available without manual symlinks.

See https://github.com/creationix/nvm for more details.

netzulo commented 6 years ago

that's just a dude ? use another directory @Rbagman to run warriorjs binary , just this :)

olistic commented 6 years ago

@Rbagman I'm closing this due to inactivity. Feel free to re-open if you're still experiencing issues.