Skip to content

Cannot start on mac: env: node\r: No such file or directory #22

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

Closed
5 tasks done
necm1 opened this issue Feb 15, 2024 · 5 comments
Closed
5 tasks done

Cannot start on mac: env: node\r: No such file or directory #22

necm1 opened this issue Feb 15, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@necm1
Copy link

necm1 commented Feb 15, 2024

Type

  • Others

Checklist

  1. Updated the package to the latest version
  2. Read all documentation
  3. No related issue
  4. Meaningful issue title

Environment

  • Package Version: v^2.2.8
  • Node Version: v20.5.1
  • NextJS: v14.1.0

Describe the bug
I just followed the tutorial and created a next-css-obfucator.config.ts file in my root directory. After building my application, I just tried to start obfuscate-build and I get following error:

yarn run v1.22.21
$ NODE_ENV=production next-css-obfuscator --config ./next-css-obfuscator.config.ts
env: node\r: No such file or directory
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
To run maybe?

Screenshots
If applicable, add screenshots to help explain your problem.

Config

import { Options } from 'next-css-obfuscator';

module.exports = {
  enable: true,
  mode: 'random',
  refreshClassConversionJson: process.env.NODE_ENV !== 'production',
  allowExtensions: ['.jsx', '.tsx', '.js', '.ts', '.html', '.rsc'],
} as Options;

Related files

Demos (if any)
N/A

Additional context
I did some research and I guess it's something related to my current OS (macOS).

@necm1 necm1 added the bug Something isn't working label Feb 15, 2024
@necm1
Copy link
Author

necm1 commented Feb 15, 2024

The file https://github.com/soranoo/next-css-obfuscator/blob/main/bin/cli.mjs seems to be saved with CRLF instead of LF and thats causing issues on unix based systems

@necm1
Copy link
Author

necm1 commented Feb 15, 2024

https://github.com/soranoo/next-css-obfuscator/blob/main/src/handlers/js-ast.test.ts seems also saved with CRLF instead of LF

@soranoo
Copy link
Owner

soranoo commented Feb 15, 2024

Have you tried converting these files(node_modules/next-css-obfuscator/...) to LF?

I don't see any issue in my Ubuntu.

@necm1
Copy link
Author

necm1 commented Feb 16, 2024

Have you tried converting these files(node_modules/next-css-obfuscator/...) to LF?

I don't see any issue in my Ubuntu.

After converting them, it worked as expected. Anyways, I guess it was important to mention it, so anyone else in the future isn't gonna face this issue. :D

@soranoo
Copy link
Owner

soranoo commented Feb 17, 2024

I formatted the cli to LF f794bbd

Everything should work as expected in the latest version.

@soranoo soranoo closed this as completed Feb 17, 2024
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

No branches or pull requests

2 participants