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

issues pls help me to solve #24

Open
johnfelipe opened this issue Jun 5, 2022 · 6 comments
Open

issues pls help me to solve #24

johnfelipe opened this issue Jun 5, 2022 · 6 comments

Comments

@johnfelipe
Copy link

root@ubuntu21:~# git clone https://github.com/goooseman/gettext-utils.git
Cloning into 'gettext-utils'...
remote: Enumerating objects: 605, done.
remote: Counting objects: 100% (103/103), done.
remote: Compressing objects: 100% (60/60), done.
remote: Total 605 (delta 45), reused 91 (delta 38), pack-reused 502
Receiving objects: 100% (605/605), 325.27 KiB | 1.46 MiB/s, done.
Resolving deltas: 100% (340/340), done.
root@ubuntu21:~# cd gettext-utils/
root@ubuntu21:~/gettext-utils# npm i --save-dev gettext-utils
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated source-map-url@0.4.0: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@3.2.6: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated uuid@3.3.2: 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 request-promise-native@1.0.7: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated set-value@2.0.0: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated mixin-deep@1.3.1: Critical bug fixed in v2.0.1, please upgrade to the latest version.
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN deprecated source-map-resolve@0.5.2: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.3: this library is no longer supported
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated chokidar@2.1.1: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm WARN deprecated @material-ui/system@3.0.0-alpha.2: You can now upgrade to @mui/system. See the guide: https://mui.com/guides/migration-v4/
npm WARN deprecated popper.js@1.14.7: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated set-value@0.4.3: Critical bug fixed in v3.0.1, please upgrade to the latest version.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated core-js@1.2.7: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated core-js@2.6.1: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated @material-ui/core@3.9.2: You can now upgrade to @mui/material. See the guide: https://mui.com/guides/migration-v4/

added 1149 packages, and audited 1150 packages in 1m

70 vulnerabilities (19 moderate, 39 high, 12 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
root@ubuntu21:~/gettext-utils# npx gettext-utils export-strings
root@ubuntu21:~/gettext-utils# cp -r/root/gettext-utils/src/ /root/XREngine/packages
cp: invalid option -- '/'
Try 'cp --help' for more information.
root@ubuntu21:~/gettext-utils# cp -r /root/gettext-utils/src/ /root/XREngine/packages
root@ubuntu21:~/gettext-utils# cp -r /root/XREngine/packages/ /root/gettext-utils/src
root@ubuntu21:~/gettext-utils# npm i --save-dev gettext-utils

up to date, audited 1150 packages in 17s

69 vulnerabilities (19 moderate, 38 high, 12 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
root@ubuntu21:~/gettext-utils# npx gettext-utils export-strings
SyntaxError: This experimental syntax requires enabling the parser plugin: 'optionalChaining' (42:22)
	at Object.raise (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:3851:17)
	at Object.expectPlugin (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5170:18)
	at Object.parseSubscript (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5951:12)
	at Object.parseSubscript (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:10296:18)
	at Object.parseSubscripts (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5937:19)
	at Object.parseExprSubscripts (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5926:17)
	at Object.parseMaybeUnary (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5896:21)
	at Object.parseMaybeUnary (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:10676:20)
	at Object.parseExprOps (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5783:23)
	at Object.parseMaybeConditional (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5756:23) {
  pos: 1580,
  loc: Position { line: 42, column: 22 },
  missingPlugin: [ 'optionalChaining' ]
}
root@ubuntu21:~/gettext-utils# gettext-utils export-strings --default-locale=en && git add src/i18n/*
gettext-utils: command not found
root@ubuntu21:~/gettext-utils# npx gettext-utils export-strings --default-locale=en && git add src/i18n/*
SyntaxError: This experimental syntax requires enabling the parser plugin: 'optionalChaining' (42:22)
	at Object.raise (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:3851:17)
	at Object.expectPlugin (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5170:18)
	at Object.parseSubscript (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5951:12)
	at Object.parseSubscript (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:10296:18)
	at Object.parseSubscripts (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5937:19)
	at Object.parseExprSubscripts (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5926:17)
	at Object.parseMaybeUnary (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5896:21)
	at Object.parseMaybeUnary (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:10676:20)
	at Object.parseExprOps (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5783:23)
	at Object.parseMaybeConditional (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:5756:23) {
  pos: 1580,
  loc: Position { line: 42, column: 22 },
  missingPlugin: [ 'optionalChaining' ]
}
root@ubuntu21:~/gettext-utils#
@goooseman
Copy link
Owner

The problem appears because you use optional chaining operator in your code (?.), which was not supported out of the box with version of babel this library uses.

Try to npm I --save-dev @babel/plugin-proposal-optional-chaining and add this plugin to your .babelrc

@johnfelipe
Copy link
Author

Can u tell me if I can extract strings from xrengine?

@johnfelipe
Copy link
Author

The problem appears because you use optional chaining operator in your code (?.), which was not supported out of the box with version of babel this library uses.

Try to npm I --save-dev @babel/plugin-proposal-optional-chaining and add this plugin to your .babelrc

root@felipe:~/gettext-utils# npm i --save-dev @babel/plugin-proposal-optional-chaining
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: lioness@0.2.13
npm ERR! Found: react@16.8.4
npm ERR! node_modules/react
npm ERR!   peer react@"^16.3.0" from @material-ui/core@3.9.2
npm ERR!   node_modules/@material-ui/core
npm ERR!     dev @material-ui/core@"^3.9.2" from the root project
npm ERR!   peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2
npm ERR!   node_modules/@material-ui/system
npm ERR!     @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.2
npm ERR!     node_modules/@material-ui/core
npm ERR!       dev @material-ui/core@"^3.9.2" from the root project
npm ERR!   6 more (@material-ui/utils, react-dom, react-event-listener, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^15.0.0" from lioness@0.2.13
npm ERR! node_modules/lioness
npm ERR!   dev lioness@"^0.2.13" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@15.7.0
npm ERR! node_modules/react
npm ERR!   peer react@"^15.0.0" from lioness@0.2.13
npm ERR!   node_modules/lioness
npm ERR!     dev lioness@"^0.2.13" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-06-06T23_29_45_589Z-debug-0.log

how next movement?

@johnfelipe
Copy link
Author

root@ubuntu21:~/gettext-utils# npx gettext-utils export-strings                 SyntaxError: Missing initializer in const declaration. (80:25)
	at instantiate (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:72:32)
	at constructor (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:358:12)
	at Object.raise (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:3341:19)
	at Object.parseVar (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:15385:16)
	at Object.parseVarStatement (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:15178:10)
	at Object.parseVarStatement (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:10318:31)
	at Object.parseStatementContent (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:14720:21)
	at Object.parseStatementContent (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:10359:18)
	at Object.parseStatement (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:14645:17)
	at Object.parseExportDeclaration (/root/gettext-utils/node_modules/@babel/parser/lib/index.js:16025:17) {
  code: 'BABEL_PARSER_SYNTAX_ERROR',
  reasonCode: 'DeclarationMissingInitializer',
  loc: Position { line: 80, column: 25, index: 2023 },
  pos: [Getter/Setter]
}

how solve this?

@goooseman
Copy link
Owner

@johnfelipe hi

I see the problem is in the version of lioness, one of the subdependencies

I will update it and release the new version soon

@goooseman
Copy link
Owner

@johnfelipe please try the following

  1. change gettext-utils version in package.json to ^2.2.1
  2. npm install
  3. try to run
  4. if same problem occurs npm I --save-dev @babel/plugin-proposal-optional-chaining and add this plugin to your .babelrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants