Skip to content

fix for importing version from package.json, on globally installed in Windows 11 #3070

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vicovaro
Copy link

When installed using npm install -g @serialport/terminal aka globally on Windows 11, it is unable to find the path needed to read the version in package.json. readFileSync() when ran as a globally installed package, it is unable to find the current working directory as it considers current terminal directory as base. So ../package.json is being read as C:\Users\package.json, which does not exist, when it is supposed to read relative to its current folder aka here C:\Users\callum\AppData\Local\nvm\v22.17.1\node_modules\@serialport\list\package.json.

The fix is to use a path resolution resolver that works globally, while following ES Modules.

image image

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

Successfully merging this pull request may close these issues.

1 participant