Snackager does not support npm 9 and above.
- Dominant language
- TypeScript
- Stars
- 508
- Forks
- 178
- Avg merge
- 5h 7m
- Merged PRs (30d)
- 5
Description
### Summary
https://github.blog/changelog/2022-10-24-npm-v9-0-0-released/
**npm bin has been removed (use npx or npm exec to execute binaries)**
```log
Error: npm bin exited with non-zero code: 1
at ChildProcess.completionListener (/Users/zhiqingchen/ajk/snack/snackager/node_modules/@expo/spawn-async/src/spawnAsync.ts:67:13)
at Object.onceWrapper (node:events:633:26)
at ChildProcess.emit (node:events:518:28)
at maybeClose (node:internal/child_process:1105:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
...
at spawnAsync (/Users/zhiqingchen/ajk/snack/snackager/node_modules/@expo/spawn-async/src/spawnAsync.ts:28:21)
at spawnSafeAsync (/Users/zhiqingchen/ajk/snack/snackager/src/utils/installDependencies.ts:27:20)
at getYarnPackagerAsync (/Users/zhiqingchen/ajk/snack/snackager/src/utils/installDependencies.ts:42:30)
at installPackage (/Users/zhiqingchen/ajk/snack/snackager/src/utils/installPackage.ts:52:42)
at main (/Users/zhiqingchen/ajk/snack/snackager/src/cli.ts:61:3) {
pid: 66462,
output: [
'Unknown command: "bin"\n' +
'\n' +
'To see a list of supported npm commands, run:\n' +
' npm help\n',
''
],
stdout: 'Unknown command: "bin"\n' +
'\n' +
'To see a list of supported npm commands, run:\n' +
' npm help\n',
stderr: '',
status: 1,
signal: null
}
```
### What platform(s) does this occur on?
Web
### SDK Version
50
### Reproducible demo or steps to reproduce from a blank project
yarn bundle react-native-elements | ./node_modules/.bin/bunyan
Contributor guide
Research direction
Start with src/utils/installDependencies.ts, especially the spawnSafeAsync call shown in the stack trace, then trace its callers in src/utils/installPackage.ts and src/cli.ts. Reproduce with `yarn bundle react-native-elements | ./node_modules/.bin/bunyan`; done means the Snackager flow works with npm 9 or newer without invoking the removed command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100