Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install dependencies #122

Closed
otiskujawa opened this issue Feb 4, 2022 · 9 comments · Fixed by #123
Closed

Can't install dependencies #122

otiskujawa opened this issue Feb 4, 2022 · 9 comments · Fixed by #123
Labels
bug Something isn't working

Comments

@otiskujawa
Copy link
Contributor

Ubuntu based distro after running "CXX=10 npm ci"

I have done everything that was written in README

2022-02-03T20_42_15_479Z-debug-0.log

@N1kO23
Copy link
Collaborator

N1kO23 commented Feb 5, 2022

Hmm, interesting. You could try to remove node_modules directory and then run npm i instead of CXX=10 npm ci. Not sure if it will make any difference, but I think it is worth a shot.

@otiskujawa
Copy link
Contributor Author

rm -r ./node_modules
npm i
2022-02-05T14_13_01_473Z-debug-0.log

@otiskujawa
Copy link
Contributor Author

I backed-up /usr/inclide/c++/11 and copied /usr/inclide/c++/10 to /usr/inclide/c++/11

┌──(otiskujawa@rimuru4)-[~/git/Shaii]
└─$ npm ci
npm WARN deprecated @types/[email protected]: This is a stub types definition. file-type provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

added 557 packages, and audited 558 packages in 3m

47 packages are looking for funding
  run npm fund for details

13 vulnerabilities (8 moderate, 5 high)

To address all issues, run:
  npm audit fix

Run npm audit for details.

after trying
npm audit fix
npm audit fix --force

┌──(otiskujawa㉿rimuru4)-[~/git/Shaii]
└─$ npm audit fix

up to date, audited 558 packages in 2s

48 packages are looking for funding
  run `npm fund` for details

# npm audit report

ansi-regex  >2.1.1 <5.0.1
Severity: moderate
 Inefficient Regular Expression Complexity in chalk/ansi-regex - https://github.com/advisories/GHSA-93q8-gq69-wqmw
fix available via `npm audit fix`
node_modules/ansi-regex
  strip-ansi  4.0.0 - 5.2.0
  Depends on vulnerable versions of ansi-regex
  node_modules/strip-ansi
    string-width  2.1.0 - 4.1.0
    Depends on vulnerable versions of strip-ansi
    node_modules/string-width

is-svg  2.1.0 - 4.2.2
Severity: high
Regular Expression Denial of Service (ReDoS) - https://github.com/advisories/GHSA-7r28-3m3f-r2pr
ReDOS in IS-SVG - https://github.com/advisories/GHSA-r8j5-h5cx-65gg
fix available via `npm audit fix`
node_modules/is-svg
  get-svg-colors  *
  Depends on vulnerable versions of cheerio
  Depends on vulnerable versions of is-svg
  node_modules/get-svg-colors

nth-check  <2.0.1
Severity: moderate
Inefficient Regular Expression Complexity in nth-check - https://github.com/advisories/GHSA-rp65-9cf3-cjxr
fix available via `npm audit fix`
node_modules/nth-check
  css-select  <=3.1.0
  Depends on vulnerable versions of nth-check
  node_modules/css-select
    cheerio  0.19.0 - 1.0.0-rc.3
    Depends on vulnerable versions of css-select
    node_modules/cheerio
      get-svg-colors  *
      Depends on vulnerable versions of cheerio
      Depends on vulnerable versions of is-svg
      node_modules/get-svg-colors

8 vulnerabilities (6 moderate, 2 high)

To address all issues, run:
  npm audit fix

$ npm run dev
(normal startup)

Error: Cannot find module '../assets/badWords.json'
Require stack:
- /home/otiskujawa/git/Shaii/src/moderation/isBadWord.shaii.ts
- /home/otiskujawa/git/Shaii/src/middleware/moderationMiddleware.shaii.ts
- /home/otiskujawa/git/Shaii/src/shaii/Shaii.shaii.ts
- /home/otiskujawa/git/Shaii/src/shaii.ts
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/home/otiskujawa/git/Shaii/node_modules/@cspotcode/source-map-support/source-map-support.js:679:30)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/home/otiskujawa/git/Shaii/src/moderation/isBadWord.shaii.ts:3:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Module.m._compile (/home/otiskujawa/git/Shaii/node_modules/ts-node/src/index.ts:1371:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Object.require.extensions.<computed> [as .ts] (/home/otiskujawa/git/Shaii/node_modules/ts-node/src/index.ts:1374:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/otiskujawa/git/Shaii/src/moderation/isBadWord.shaii.ts',
    '/home/otiskujawa/git/Shaii/src/middleware/moderationMiddleware.shaii.ts',
    '/home/otiskujawa/git/Shaii/src/shaii/Shaii.shaii.ts',
    '/home/otiskujawa/git/Shaii/src/shaii.ts'
  ]
}
[nodemon] app crashed - waiting for file changes before starting...

@N1kO23
Copy link
Collaborator

N1kO23 commented Feb 5, 2022

Oh alright, the bot is working now.
That error regarding to '../assets/badWords.json' is because the bot needs that file and it is not autocreated if it is missing. This can be easily fixed by creating the file manually and inside that file you have json array that contains all the bad/banned words.

@otiskujawa
Copy link
Contributor Author

Ok
I do not close because the problem still occurs for people who do not want to change system files

npm ci is using c++ 11 instead of 10 and CXX=10 is not working

Ubuntu based distro

@Geoxor Geoxor added the bug Something isn't working label Feb 6, 2022
@Geoxor Geoxor linked a pull request Feb 6, 2022 that will close this issue
@qexat
Copy link
Contributor

qexat commented Feb 6, 2022

Ok I do not close because the problem still occurs for people who do not want to change system files

npm ci is using c++ 11 instead of 10 and CXX=10 is not working

Ubuntu based distro

I think this is because of a mistake in the README. The correct command to do is:

CXX=g++-10 npm ci

@qexat
Copy link
Contributor

qexat commented Feb 6, 2022

Ok I found a better solution (doesn't require to have g++ which is, if I remember correctly, not installed on all systems by default):

CXX=gcc-10 npm i

CXX command prefix apparently does not accept implicit compiler naming, so specifying only the version is not enough and will not find it, making it switching to default version (gcc-11) which doesn't support Angle for an unknown reason (see issue #214 of libANGLE repository)

@qexat
Copy link
Contributor

qexat commented Feb 6, 2022

Issue solved by this commit. Thanks @N1kO23

@otiskujawa
Copy link
Contributor Author

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants