Page MenuHomePhabricator

Can't npm install without deleting package-lock
Closed, ResolvedPublic

Description

When I try to install codex i get the following error:

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for esbuild-android-arm64@0.13.4: wanted {"os":"android","arch":"arm64"} (current: {"os":"darwin","arch":"x64"})
npm ERR! notsup Valid OS:    android
npm ERR! notsup Valid Arch:  arm64
npm ERR! notsup Actual OS:   darwin
npm ERR! notsup Actual Arch: x64

After deleting package-lock and installing I get missing script: build-if-missing

Event Timeline

What versions of node and npm are you running? Codex requires node 12.21.0 at the moment (pinned in .nvmrc, so you can run nvm install && nvm use), and npm 7.0.0 or greater, which you'll have to install manually. I'm using npm v8.0.0 FWIW

Interestingly, I ran into exactly the same warning with OOUI recently. Jenkins CI “node12” images for OOUI run now with 12.22.5. Although Codex and its “quibble” images run with node 14.17.5 I've failed to update it locally so far. 12.22.5 could be a temporary mitigation.
Make sure you clean npm cache, not only rely on removing node_modules and package-lock.json. Switches between node versions have resulted in headache and lost hours for me with before as one of the ways out sometimes.

npm was the issue here.

If npm 7 is required that should likely be noted in README. It can be installed by nvm install --latest-npm

After doing that I can install but I get the following warnings:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-visitor-keys@3.1.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.21.0', npm: '8.3.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'espree@9.2.0',
npm WARN EBADENGINE   required: { node: '^12.22.0 || ^14.17.0 || >=16.0.0' },
npm WARN EBADENGINE   current: { node: 'v12.21.0', npm: '8.3.0' }
npm WARN EBADENGINE }
npm WARN deprecated @stylelint/postcss-markdown@0.36.2: Use the original unforked package instead: postcss-markdown
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

Change 749556 had a related patch set uploaded (by Anne Tomasevich; author: Anne Tomasevich):

[design/codex@main] docs: Add basic development info to README

https://gerrit.wikimedia.org/r/749556

Change 749556 merged by jenkins-bot:

[design/codex@main] docs: Add basic development info to README

https://gerrit.wikimedia.org/r/749556

Volker_E claimed this task.

Putting this on resolved (due to improved README).