vscode-solidity icon indicating copy to clipboard operation
vscode-solidity copied to clipboard

Make npm package compatible with Windows

Open allisterb opened this issue 2 years ago • 0 comments

I'm able to compile and use this language server on Windows:

$ npm run build:cli

> [email protected] build:cli
> tsup src/server.ts -d dist/cli && sh scripts/add_shebang.sh dist/cli/server.js

CLI Building entry: src/server.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v7.1.0
CLI Using tsup config: c:\Projects\vscode-solidity\tsup.config.ts
CLI Target: es6
CLI Cleaning output folder
CJS Build start
CJS dist\cli\server.js 122.84 KB
CJS ⚡️ Build success in 1478ms
'sh' is not recognized as an internal or external command,
operable program or batch file.

Just the last step of running the sh script won't work in a Windows environment.

However I cannot install the npm package:

$ npm install @llllvvuu/vscode-solidity-langserver                                                             
npm ERR! code EBADPLATFORM                                                                                     
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"!win32"} (current: {"os":"win32","arch":"x64"})
npm ERR! notsup Valid OS:    !win32                                                                            
npm ERR! notsup Valid Arch:  undefined                                                                         
npm ERR! notsup Actual OS:   win32                                                                             
npm ERR! notsup Actual Arch: x64                                                                               
                                                                                                               
npm ERR! A complete log of this run can be found in:                                                           
npm ERR!     C:\Users\Allister\AppData\Local\npm-cache\_logs\2023-12-28T15_29_28_234Z-debug-0.log              

Same thing if I pack and try to install locally from the vscode-solidity repo folder.

I'm not a node developer so I'm not sure which dependency is causing this. This is from the log file:

1357 verbose stack Error: Unsupported platform
1357 verbose stack     at checkPlatform (C:\nodejs\node_modules\npm\node_modules\npm-install-checks\index.js:35:25)
1357 verbose stack     at Arborist.[checkPlatform] (C:\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:237:5)
1357 verbose stack     at Arborist.[checkEngineAndPlatform] (C:\nodejs\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:231:29)
1

However I've been using the language server in my own Windows-based project and haven't encountered any issues or Windows incompatibility.

allisterb avatar Dec 29 '23 15:12 allisterb