Closed
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
When using npm view <package> <selector> --json
, I expect only to receive JSON data types. Unfortunately, for [email protected]
that's not the case anymore.
Running npm view expo-template-bare-minimum@sdk-51 dist.tarball --json
now yields the tarball
string, without quotes, making it not a JSON result anymore.

Expected Behavior
When using this same command with [email protected]
, the response is wrapped in quotes, making it a valid JSON response (or at least parsable through JSON.parse(...)
.

Steps To Reproduce
Result that's not parsable with JSON.parse
:
$ npm i -g [email protected]
$ npm -v
→ Should return10.8.0
$ npm view expo-template-bare-minimum@sdk-51 dist.tarball --json
→ Should returnhttps://...
(without quotes)
Result that is parsable with JSON.parse
:
$ npm i -g [email protected]
$ npm -v
→ Should return10.7.0
$ npm view expo-template-bare-minimum@sdk-51 dist.tarball --json
→ Should return"https://..."
(with quotes)
Environment
- npm: 10.8.0
- Node.js: 22.2.0
- OS Name: macOS Sanoma 14.4.1
- System Model Name: MacBook Pro (14" 2023)
- npm config:
; "user" config from /Users/cedric/.npmrc
//registry.npmjs.org/:_authToken = (protected)
store-dir = "/Users/cedric/.pnpm"
; node bin location = /Users/cedric/.nvm/versions/node/v22.2.0/bin/node
; node version = v22.2.0
; npm local prefix = /Users/cedric/Desktop
; npm version = 10.8.0
; cwd = /Users/cedric/Desktop
; HOME = /Users/cedric
; Run `npm config ls -l` to show all defaults.