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

fix(package.json): npm scripts using cross-env #174

Merged
merged 1 commit into from
Feb 25, 2023

Conversation

SofianD
Copy link
Contributor

@SofianD SofianD commented Feb 25, 2023

No description provided.

@tony-go
Copy link
Member

tony-go commented Feb 25, 2023

hey @SofianD 👋🏼

Thanks for this contribution 🙌🏼

Could you explain to me what it fixed?

@SofianD
Copy link
Contributor Author

SofianD commented Feb 25, 2023

hey @SofianD 👋🏼

Thanks for this contribution 🙌🏼

Could you explain to me what it fixed?

Hi @tony-go

When running the old commands on Windows, an error occurs because Windows can only use recognized commands. And on Windows the environment variable syntax is different from that on systems using the POSIX standard.

Below is a copy of the error that occurs (in french, sorry):

> @nodesecure/cli@2.1.2 test-only
> NODE_OPTIONS=--loader=esmock cross-env tap --test-regex='.spec.js' --no-check-coverage

'NODE_OPTIONS' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

The cross-env package allows us to ignore syntax issues (cross-env set variables then cross-spawn is used to run the command), but as the examples in the documentation show, commands must start with the keyword 'cross-env' even if it's not said literally.
Otherwise, the command execution seems to be split into two parts (before and after the 'cross-env' keyword).

Feel free to tell me if I misunderstood something.

@fraxken fraxken merged commit 5ebd8dc into NodeSecure:master Feb 25, 2023
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

Successfully merging this pull request may close these issues.

3 participants