Skip to content

Commit

Permalink
fix: error out if npm is used (#2736)
Browse files Browse the repository at this point in the history
This PR introduces the usage of `please-use-pnpm` to cause usage of
`npm` or `yarn` to bork e.g.

```
❯ npm install
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE   package: '[email protected]',
npm warn EBADENGINE   required: {
npm warn EBADENGINE     npm: 'please-use-pnpm',
npm warn EBADENGINE     yarn: 'please-use-pnpm',
npm warn EBADENGINE     pnpm: '>=9.9.0',
npm warn EBADENGINE     node: '>=22.7.0'
npm warn EBADENGINE   },
npm warn EBADENGINE   current: { node: 'v22.8.0', npm: '10.8.2' }
npm warn EBADENGINE }
npm error code 127
npm error path /path/to/ftl/node_modules/.pnpm/@codemirror[email protected]/node_modules/@codemirror/state
npm error command failed
npm error command sh -c cm-buildhelper src/index.ts
npm error sh: cm-buildhelper: command not found
npm error A complete log of this run can be found in: /path/to/ftl/.hermit/node/cache/_logs/2024-09-19T17_43_47_183Z-debug-0.log
```

> [!IMPORTANT]
> there is another [blessed way](https://pnpm.io/only-allow-pnpm) to do
this but i couldn't get it to work due to some `codemirror` linter thing
that's caked in somewhere

> [!IMPORTANT]
> the example output above was produced by running `npm install` from
within the `console` directory. presumably we'll want this to work from
the root. @wesbillman i've got some questions for you before pushing
that through
  • Loading branch information
mistermoe authored Sep 20, 2024
1 parent f1ce9bc commit 26ca5bd
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frontend/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"private": true,
"type": "module",
"engines": {
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": ">=9.9.0",
"node": ">=22.7.0"
},
Expand Down Expand Up @@ -56,6 +58,7 @@
"highlight.js": "^11.8.0",
"hugeicons-react": "^0.3.0",
"json-schema-faker": "0.5.6",
"please-use-pnpm": "^1.1.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.26.2",
Expand Down
Loading

0 comments on commit 26ca5bd

Please sign in to comment.