You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a sanity studio has a postinstall script that outputs something to stdout, sanity upgrade will fail with a JSON parse error. I suspect this may also happen if any package in the dependency tree has postinstall script that outputs something else than valid json, but haven't been able to confirm it.
Steps to reproduce:
Run sanity init
Manually install a previous version of any of the packages, e.g with npm install @sanity/base@0.117.0
open package.json, and add the following line to the scripts-section:
"postinstall": "echo 'postinstall'"
Run sanity upgrade
I get the error:
undefined:1
postinstall
^
SyntaxError: Unexpected token p in JSON at position 0
at DestroyableTransform.parse [as mapper] (<anonymous>)
at DestroyableTransform.transform [as _transform] (~/.nvm/versions/node/v8.8.0/lib/node_modules/@sanity/cli/node_modules/split2/index.js:33:21)
at DestroyableTransform.Transform._read (~/.nvm/versions/node/v8.8.0/lib/node_modules/@sanity/cli/node_modules/readable-stream/lib/_stream_transform.js:182:10)
at DestroyableTransform.Transform._write (~/.nvm/versions/node/v8.8.0/lib/node_modules/@sanity/cli/node_modules/readable-stream/lib/_stream_transform.js:170:83)
at doWrite (~/.nvm/versions/node/v8.8.0/lib/node_modules/@sanity/cli/node_modules/readable-stream/lib/_stream_writable.js:406:64)
at writeOrBuffer (~/.nvm/versions/node/v8.8.0/lib/node_modules/@sanity/cli/node_modules/readable-stream/lib/_stream_writable.js:395:5)
at DestroyableTransform.Writable.write (~/.nvm/versions/node/v8.8.0/lib/node_modules/@sanity/cli/node_modules/readable-stream/lib/_stream_writable.js:322:11)
at Socket.ondata (_stream_readable.js:639:20)
at emitOne (events.js:120:20)
at Socket.emit (events.js:210:7)
The text was updated successfully, but these errors were encountered:
If a sanity studio has a postinstall script that outputs something to stdout,
sanity upgrade
will fail with a JSON parse error. I suspect this may also happen if any package in the dependency tree haspostinstall
script that outputs something else than valid json, but haven't been able to confirm it.Steps to reproduce:
sanity init
npm install @sanity/base@0.117.0
package.json
, and add the following line to thescripts
-section:sanity upgrade
I get the error:
The text was updated successfully, but these errors were encountered: