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

[Bug]: SyntaxError: Unexpected identifier 'assert' #492

Closed
ShivamB25 opened this issue May 16, 2024 · 3 comments · Fixed by #493
Closed

[Bug]: SyntaxError: Unexpected identifier 'assert' #492

ShivamB25 opened this issue May 16, 2024 · 3 comments · Fixed by #493
Labels
bug Something isn't working

Comments

@ShivamB25
Copy link

What happened?

When running the command npx preevy init, I encountered the following error:
SyntaxError: Unexpected identifier 'assert'

Add screenshots

image

Steps to reproduce the behavior

  1. Open a terminal or command prompt.
  2. Run the command npx preevy init.
  3. The error SyntaxError: Unexpected identifier 'assert' is displayed.
  4. Run the command preevy init.
  5. The same error SyntaxError: Unexpected identifier 'assert' is displayed.

Expected behavior

expected the Preevy project initialization process to start without any errors. However, instead of the expected behavior, I encountered the SyntaxError: Unexpected identifier 'assert' error.[1]

What OS are you seeing the problem on?

MacOS

Additional context

while installing i received this:

npm install -g preevy
⠼
⠦
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated uuid@3.4.0: 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 @aws-sdk/util-waiter@3.374.0: This package has moved to @smithy/util-waiter

added 766 packages in 2m```

nodejs version:
node -v
v22.1.0

### Record

- [X] I agree to follow this project's Code of Conduct
@ShivamB25 ShivamB25 added the bug Something isn't working label May 16, 2024
@royra
Copy link
Collaborator

royra commented May 17, 2024

Hi @ShivamB25

  • Can you try with Node.js v18.19.1? You can use nvm to easily switch between Node.js versions.
  • If this doesn't work, can you please run DEBUG='*' preevy init --debug and copy the full trace details?

@royra royra changed the title [Bug]: [Bug]: SyntaxError: Unexpected identifier 'assert' May 17, 2024
@royra
Copy link
Collaborator

royra commented May 17, 2024

Looks related to the latest changes in Node.js 22: nodejs/node#52104

royra pushed a commit that referenced this issue May 18, 2024
- replace import `assert` keyword with `with`, see #492
- upgrade azure package to support node v22
royra pushed a commit that referenced this issue May 18, 2024
- replace import `assert` keyword with `with`, see #492
- upgrade azure package to support node v22

fixes #492
royra pushed a commit that referenced this issue May 28, 2024
- replace import `assert` keyword with `with`, see #492
- upgrade azure package to support node v22

fixes #492
royra added a commit that referenced this issue May 28, 2024
- remove import `with` keyword, see #492. tried replacing with newer `assert` syntax but it was [breaking](nodejs/node#52104 (comment)) older node 18 versions.
- upgrade azure package to support node v22
- bump packaged oclif node version to latest LTS (20.13.1)
- bump node version for CI workflows to 20.x
- keep supported version in package.json to >=18.0.0

---------

Co-authored-by: Roy Razon <roy@livecycle.io>
@ShivamB25
Copy link
Author

thank you

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.

2 participants