Skip to content

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