Closed EzioTheDeadPoet closed 4 years ago
Which version of yarn
are you using?
I installed it via a package of tools using sudo apt install <package name>
that I got promted to install on the server, after it didn't recognize the command, sadly my pc crashed since and i am not sure what the package name was, but the yarn version is 0.22, figured that much out using yarn --version
command.
Try yarn run build && yarn run start
../shulker$ yarn run build && yarn run start
ERROR: [Errno 2] No such file or directory: 'run
Sadly that didn't work.
any other idea what I could try, or should I maybe try an older version of the tool ?
Can you try following the instructions here? https://github.com/yarnpkg/yarn/issues/3708 You may possibly have another package installed
The install script has never failed me either https://classic.yarnpkg.com/en/docs/install
shulker$ sudo yarn build && yarn start
yarn run v1.22.4
$ tsc
src/Discord.ts:1:55 - error TS2307: Cannot find module 'discord.js'.
1 import {Client, Message, Snowflake, TextChannel} from 'discord.js'
~~~~~~~~~~~~
src/Discord.ts:3:24 - error TS2307: Cannot find module 'emoji-strip'.
3 import emojiStrip from 'emoji-strip'
~~~~~~~~~~~~~
src/Discord.ts:4:19 - error TS2307: Cannot find module 'axios'.
4 import axios from 'axios'
~~~~~~~
src/Discord.ts:32:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
32 console.log('[ERROR] Could not authenticate with Discord: ' + e)
~~~~~~~
src/Discord.ts:33:30 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
33 if (this.config.DEBUG) console.error(e)
~~~~~~~
src/Discord.ts:44:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
44 console.log(`[INFO] Found channel #${channel.name} (id: ${channel.id}) in the server "${channel.guild.name}"`)
~~~~~~~
src/Discord.ts:46:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
46 console.log(`[INFO] Could not find channel ${name}! Check that the name is correct or use the ID of the channel instead (DISCORD_CHANNEL_ID)!`)
~~~~~~~
src/Discord.ts:47:7 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i @types/node`.
47 process.exit(1)
~~~~~~~
src/Discord.ts:67:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
67 console.log('[ERROR] Could not auth with the server!')
~~~~~~~
src/Discord.ts:68:30 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
68 if (this.config.DEBUG) console.error(e)
~~~~~~~
src/Discord.ts:74:29 - error TS7006: Parameter 'r' implicitly has an 'any' type.
74 if (author.roles.find(r => this.config.SLASH_COMMAND_ROLES.includes(r.name))) {
~
src/Discord.ts:78:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
78 console.log('[INFO] User attempted a slash command without a role')
~~~~~~~
src/Discord.ts:86:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
86 console.log('[ERROR] Could not send command!')
~~~~~~~
src/Discord.ts:87:32 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
87 if (this.config.DEBUG) console.error(e)
~~~~~~~
src/Discord.ts:114:49 - error TS7006: Parameter 'user' implicitly has an 'any' type.
114 const user = this.client.users.find(user => user.username === username && user.discriminator === mentionParts[1])
~~~~
src/Discord.ts:165:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
165 console.log('[ERROR] Could not send Discord message through WebHook!')
~~~~~~~
src/Discord.ts:166:32 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
166 if (this.config.DEBUG) console.log(e)
~~~~~~~
src/Discord.ts:170:50 - error TS7006: Parameter 'ch' implicitly has an 'any' type.
170 const channel = this.client.channels.find((ch) => ch.id === this.config.DISCORD_CHANNEL_ID && ch.type === 'text') as TextChannel
~~
src/Discord.ts:174:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
174 console.log(`[ERROR] Could not find channel with ID ${this.config.DISCORD_CHANNEL_ID}!`)
~~~~~~~
src/MinecraftHandler.ts:1:16 - error TS2307: Cannot find module 'fs'.
1 import fs from 'fs'
~~~~
src/MinecraftHandler.ts:2:18 - error TS2307: Cannot find module 'path'.
2 import path from 'path'
~~~~~~
src/MinecraftHandler.ts:3:22 - error TS2307: Cannot find module 'tail'.
3 import { Tail } from 'tail'
~~~~~~
src/MinecraftHandler.ts:4:21 - error TS2307: Cannot find module 'express'.
4 import express from 'express'
~~~~~~~~~
src/MinecraftHandler.ts:33:30 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
33 if (this.config.DEBUG) console.log('[DEBUG] Line ignored')
~~~~~~~
src/MinecraftHandler.ts:37:28 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
37 if (this.config.DEBUG) console.log('[DEBUG] Received ' + data)
~~~~~~~
src/MinecraftHandler.ts:48:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
48 console.log('[DEBUG] Regex could not match the string:')
~~~~~~~
src/MinecraftHandler.ts:49:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
49 console.log('Received: "' + data + '", Regex matches lines that start with: "' + this.config.REGEX_SERVER_PREFIX + '"')
~~~~~~~
src/MinecraftHandler.ts:61:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
61 console.log('[DEBUG]: A player sent a chat message')
~~~~~~~
src/MinecraftHandler.ts:68:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
68 console.log('[ERROR] Could not parse message: ' + logLine)
~~~~~~~
src/MinecraftHandler.ts:75:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
75 console.log('[DEBUG] Username: ' + matches[1])
~~~~~~~
src/MinecraftHandler.ts:76:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
76 console.log('[DEBUG] Text: ' + matches[2])
~~~~~~~
src/MinecraftHandler.ts:87:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
87 console.log(`[DEBUG]: A player's connection status changed`)
~~~~~~~
src/MinecraftHandler.ts:94:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
94 console.log('[DEBUG] A player has made an advancement')
~~~~~~~
src/MinecraftHandler.ts:109:13 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
109 console.log(
~~~~~~~
src/MinecraftHandler.ts:125:19 - error TS7006: Parameter 'request' implicitly has an 'any' type.
125 this.app.use((request, response, next) => {
~~~~~~~
src/MinecraftHandler.ts:125:28 - error TS7006: Parameter 'response' implicitly has an 'any' type.
125 this.app.use((request, response, next) => {
~~~~~~~~
src/MinecraftHandler.ts:125:38 - error TS7006: Parameter 'next' implicitly has an 'any' type.
125 this.app.use((request, response, next) => {
~~~~
src/MinecraftHandler.ts:138:41 - error TS7006: Parameter 'req' implicitly has an 'any' type.
138 this.app.post(this.config.WEBHOOK, (req, res) => {
~~~
src/MinecraftHandler.ts:138:46 - error TS7006: Parameter 'res' implicitly has an 'any' type.
138 this.app.post(this.config.WEBHOOK, (req, res) => {
~~~
src/MinecraftHandler.ts:146:33 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i @types/node`.
146 const port: number = Number(process.env.PORT) || this.config.PORT
~~~~~~~
src/MinecraftHandler.ts:149:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
149 console.log('[INFO] Bot listening on *:' + port)
~~~~~~~
src/MinecraftHandler.ts:159:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
159 console.log('[INFO] Please enter the following command on your server running the Minecraft server:')
~~~~~~~
src/MinecraftHandler.ts:161:11 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
161 console.log(' Replace "PATH_TO_MINECRAFT_SERVER_INSTALL" with the path to your Minecraft server install')
~~~~~~~
src/MinecraftHandler.ts:162:27 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
162 if (defaultUrl) console.log(' and "YOUR_URL" with the URL/IP of the server running Shulker!')
~~~~~~~
src/MinecraftHandler.ts:164:27 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
164 if (defaultUrl) console.log(' Replace "YOUR_URL" with the URL/IP of the server running Shulker')
~~~~~~~
src/MinecraftHandler.ts:173:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
173 console.log(` \`tail -F ${mcPath} | grep --line-buffered "${grepMatch}" | while read x ; do echo -ne $x | curl -X POST -d @- http://${url}:${port}${this.config.WEBHOOK} ; done\``)
~~~~~~~
src/MinecraftHandler.ts:175:11 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
175 console.log(' Please note that the above command can send a lot of requests to the server. Disable the non-text messages (such as "SHOW_PLAYER_CONN_STAT") to reduce this if necessary.')
~~~~~~~
src/MinecraftHandler.ts:183:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
183 console.log(`[INFO] Using configuration for local log file at "${this.config.LOCAL_FILE_PATH}"`)
~~~~~~~
src/MinecraftHandler.ts:196:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
196 console.log('[ERROR] Error tailing log file: ' + error)
~~~~~~~
src/Rcon.ts:3:17 - error TS2307: Cannot find module 'net'.
3 import net from 'net'
~~~~~
src/Rcon.ts:32:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
32 console.log('[INFO] Authenticated with ' + ip + ':' + port)
~~~~~~~
src/Rcon.ts:35:35 - error TS2580: Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node`.
35 this.socket.on('data', (data: Buffer) => {
~~~~~~
src/Rcon.ts:43:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
43 console.log('Unexpected rcon response', id, type, response)
~~~~~~~
src/Rcon.ts:47:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
47 console.log('[DEBUG] Rcon closed!')
~~~~~~~
src/Rcon.ts:64:9 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
64 console.log('[ERROR] Could not send password to Rcon server!')
~~~~~~~
src/Rcon.ts:65:25 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
65 if (this.debug) console.error(e)
~~~~~~~
src/Rcon.ts:74:13 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
74 console.log('[ERROR] Could not send password to Rcon server!')
~~~~~~~
src/Rcon.ts:75:29 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
75 if (this.debug) console.error(e)
~~~~~~~
src/Rcon.ts:94:18 - error TS2552: Cannot find name 'Buffer'. Did you mean 'buff'?
94 const buff = Buffer.alloc(length)
~~~~~~
src/Rcon.ts:94:11
94 const buff = Buffer.alloc(length)
~~~~
'buff' is declared here.
src/Rcon.ts:106:23 - error TS2304: Cannot find name 'setTimeout'.
106 const timeout = setTimeout(() => {
~~~~~~~~~~
src/Rcon.ts:112:9 - error TS2304: Cannot find name 'clearTimeout'.
112 clearTimeout(timeout)
~~~~~~~~~~~~
src/Rcon.ts:115:11 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
115 console.log('[DEBUG] Received response: ' + response)
~~~~~~~
src/Shulker.ts:15:25 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i @types/node`.
15 const configFile = (process.argv.length > 2) ? process.argv[2] : '../config.json'
~~~~~~~
src/Shulker.ts:15:52 - error TS2580: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i @types/node`.
15 const configFile = (process.argv.length > 2) ? process.argv[2] : '../config.json'
~~~~~~~
src/Shulker.ts:16:5 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
16 console.log('[INFO] Using configuration file:', configFile)
~~~~~~~
src/Shulker.ts:17:19 - error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node`.
17 this.config = require(configFile)
~~~~~~~
src/Shulker.ts:19:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
19 console.log('[ERROR] Could not load config file!')
~~~~~~~
src/Shulker.ts:24:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
24 console.log('[INFO] Using Discord WebHooks to send messages')
~~~~~~~
src/Shulker.ts:26:7 - error TS2584: Cannot find name 'console'. Do you need to change your target library? Try changing the `lib` compiler option to include 'dom'.
26 console.log('[INFO] Using the Discord bot to send messages')
~~~~~~~
Found 69 errors.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Ok figured it out but now I am encountering this. :/ (Already installed typescript and changed some permission stuff, that was giving me other issues to get even this far.)
Did you yarn install
/yarn
before running those commands?
shulker$ sudo yarn add / yarn
yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "unsure how to copy this: /dev/autofs".
info If you think this is a bug, please open a bug report with the information provided in "/home/users/luca/mcvanilla/shulker/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
The Error Log https://pastebin.com/PxBkRcSs
No just run yarn install
warning " > discord.js@11.5.1" has unmet peer dependency "@discordjs/uws@^10.149.0".
warning "tslint-config-standard > tslint-eslint-rules@5.4.0" has unmet peer dependency "tslint@^5.0.0".
are these normal ? (besides those warnings everything went through with the install this time.)
Yeah, those are okay.
[ERROR] Could not send Discord message through WebHook!
Any idea what could cause this but at least the bot is running now :D
Nevermind it is running now, thank you very much for your Help getting it running. It probably just needed some more time to setup.
../shulker$ yarn build && yarn start
ERROR: [Errno 2] No such file or directory: 'build'
../shulker$ yarn
ERROR: There are no scenarios; must have at least one.
Can someone help me here ? I really would love to be able to use this tool.