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

failed to install the newest version of winglang #1578

Closed
ainvoner opened this issue Feb 19, 2023 · 4 comments · Fixed by #1580
Closed

failed to install the newest version of winglang #1578

ainvoner opened this issue Feb 19, 2023 · 4 comments · Fixed by #1580
Assignees
Labels
🐛 bug Something isn't working ⌨️ cli CLI p0

Comments

@ainvoner
Copy link
Contributor

ainvoner commented Feb 19, 2023

Community Note

Please vote by adding a 👍 reaction to the issue to help us prioritize.
If you are interested to work on this issue, please leave a comment.

I tried this:

npm i -g winglang

I expected this:

winglang newest version to be installed globally while using npm version 8 or 9 major versions

Instead, this happened:

npm version 8.6.0

npm ERR! code 1
npm ERR! path C:\Users\ainvoner\AppData\Roaming\npm\node_modules\winglang\node_modules\wasi-js
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npx only-allow pnpm
npm ERR! 'only-allow' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

npm version 9.2.0

npm notice 
npm notice New minor version of npm available! 9.2.0 -> 9.5.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.5.0
npm notice Run npm install -g [email protected] to update!
npm notice 
npm ERR! code 127
npm ERR! path /Users/urib/.nvm/versions/node/v19.3.0/lib/node_modules/winglang/node_modules/wasi-js
npm ERR! command failed
npm ERR! command sh -c npx only-allow pnpm
npm ERR! npm WARN exec The following package was not found and will be installed: [email protected]
npm ERR! sh: only-allow: command not found
npm ERR! npm notice 
npm ERR! npm notice New minor version of npm available! 9.2.0 -> 9.5.0
npm ERR! npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.5.0>
npm ERR! npm notice Run `npm install -g [email protected]` to update!
npm ERR! npm notice

npm version 9.5.0

npm ERR! code 127
npm ERR! path /Users/ainvoner/.nvm/versions/node/v18.0.0/lib/node_modules/winglang/node_modules/wasi-js
npm ERR! command failed
npm ERR! command sh -c npx only-allow pnpm
npm ERR! sh: only-allow: command not found

Component:

CLI

Wing Version:

0.5.53

Node.js Version:

v18.0.0

Platform(s):

MacOS, Windows

Anything else?

@ainvoner ainvoner added 🐛 bug Something isn't working ⌨️ cli CLI labels Feb 19, 2023
@monadabot monadabot added this to Wing Feb 19, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Feb 19, 2023
@ainvoner ainvoner added the p0 label Feb 19, 2023
@staycoolcall911 staycoolcall911 moved this from 🆕 New - not properly defined to 🤝 Backlog - handoff to owners in Wing Feb 19, 2023
@trondhindenes
Copy link
Collaborator

trondhindenes commented Feb 19, 2023

I'm getting the same. 0.5.51 works, 0.5.52 and 0.5.53 fails with this error

@staycoolcall911
Copy link
Contributor

Thanks @ainvoner and @trondhindenes - we're working on a fix.

@mergify mergify bot closed this as completed in #1580 Feb 19, 2023
mergify bot pushed a commit that referenced this issue Feb 19, 2023
Fixes #1578 by bundling wasi-js so it does not run its own preinstall script. Pretty heavy handed, but not sure what else to do.

The real fix needed is pnpm/only-allow#13

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Monada Contribution License](https://docs.winglang.io/terms-and-policies/contribution-license.html)*.
@github-project-automation github-project-automation bot moved this from 🤝 Backlog - handoff to owners to ✅ Done in Wing Feb 19, 2023
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.5.54.

@staycoolcall911
Copy link
Contributor

Issue was finally fixed in Wing 0.5.55.

mergify bot pushed a commit that referenced this issue Feb 20, 2023
This PR reintroduces #1571 with 3 additional changes to avoid [the last regression](#1578):
- `patch-package` is used to mess with wasi-js, to remove the preinstall script from their package.json. The patching is performed during packaging, where it's actually effective (for downstream consumers).
- wasi-js is included as a bundled dep for winglang to ensure that the patched `package.json` is appropriately patched in time to avoid any hooks. Normally this isn't needed with patch package, but due to the particular mutation I'm not sure this is avoidable
- Added checks to hangar to ensure we avoid introducing script hooks. I verified that these tests pass with the latest version of the repo but fail the version noted in the regression.

The changes from the original PR are untouched.

*By submitting this pull request, I confirm that my contribution is made under the terms of the [Monada Contribution License](https://docs.winglang.io/terms-and-policies/contribution-license.html)*.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working ⌨️ cli CLI p0
Projects
Archived in project
5 participants