Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create-sanity 3.1.3 installation error #4035

Closed
crisanmm opened this issue Jan 3, 2023 · 3 comments
Closed

create-sanity 3.1.3 installation error #4035

crisanmm opened this issue Jan 3, 2023 · 3 comments

Comments

@crisanmm
Copy link

crisanmm commented Jan 3, 2023

Describe the bug

Error running install command from docs:

npm create sanity@latest -- --template clean --create-project "Sanity Project" --dataset production

To Reproduce

Steps to reproduce the behavior:

Run npm create sanity@3.1.3

stderr output:

/Users/crisanmm/.npm/_npx/0b8801f1f4938509/node_modules/@sanity/cli/lib/_chunks/cli-9d378218.js:11457
if(isSimpleWindowsTerm){ansiStyles.blue.open='\u001B[94m';}for(const key of Object.keys(ansiStyles)){ansiStyles[key].closeRe=new RegExp(escapeStringRegexp(ansiStyles[key].close),'g');styles[key]={get(){const codes=ansiStyles[key];return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,key);}};}styles.visible={get(){return build.call(this,this._styles||[],true,'visible');}};ansiStyles.color.closeRe=new RegExp(escapeStringRegexp(ansiStyles.color.close),'g');for(const model of Object.keys(ansiStyles.color.ansi)){if(skipModels.has(model)){continue;}styles[model]={get(){const level=this.level;return function(){const open=ansiStyles.color[levelMapping[level]][model].apply(null,arguments);const codes={open,close:ansiStyles.color.close,closeRe:ansiStyles.color.closeRe};return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,model);};}};}ansiStyles.bgColor.closeRe=new RegExp(escapeStringRegexp(ansiStyles.bgColor.close),'g');for(const model of Object.keys(ansiStyles.bgColor.ansi)){if(skipModels.has(model)){continue;}const bgModel='bg'+model[0].toUpperCase()+model.slice(1);styles[bgModel]={get(){const level=this.level;return function(){const open=ansiStyles.bgColor[levelMapping[level]][model].apply(null,arguments);const codes={open,close:ansiStyles.bgColor.close,closeRe:ansiStyles.bgColor.closeRe};return build.call(this,this._styles?this._styles.concat(codes):[codes],this._empty,model);};}};}const proto=Object.defineProperties(()=>{},styles);function build(_styles,_empty,key){const builder=function(){return applyStyle.apply(builder,arguments);};builder._styles=_styles;builder._empty=_empty;const self=this;Object.defineProperty(builder,'level',{enumerable:true,get(){return self.level;},set(level){self.level=level;}});Object.defineProperty(builder,'enabled',{enumerable:true,get(){return self.enabled;},set(enabled){self.enabled=enabled;}});// See below for fix regarding invisible grey/dim combination on Windows
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^

TypeError: Cannot read properties of undefined (reading 'close')
    at /Users/crisanmm/.npm/_npx/0b8801f1f4938509/node_modules/@sanity/cli/lib/_chunks/cli-9d378218.js:11457:476
    at Object.<anonymous> (/Users/crisanmm/.npm/_npx/0b8801f1f4938509/node_modules/@sanity/cli/lib/_chunks/cli-9d378218.js:11477:3)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Users/crisanmm/.npm/_npx/0b8801f1f4938509/node_modules/@sanity/cli/lib/run.js:4:11)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)

Node.js v18.12.1

Expected behavior

Shouldn't error.

Which versions of Sanity are you using?

3.1.3

What operating system are you using?

macOS Ventura 13.0.1

Which versions of Node.js / npm are you running?

8.19.2
v18.12.1

Additional context

At the moment of writing this issue latest resolves to 3.1.3, the above command works fine on 3.1.2

@cjohansen11
Copy link

I am getting the same error. After install 3.1.3 I received the following error when attempting to run any sanity command

TypeError: Cannot read properties of undefined (reading 'close')
    at /Users/chich/.nvm/versions/node/v16.14.0/lib/node_modules/sanity/node_modules/@sanity/cli/lib/_chunks/cli-9d378218.js:11457:476
    at Object.<anonymous> (/Users/chich/.nvm/versions/node/v16.14.0/lib/node_modules/sanity/node_modules/@sanity/cli/lib/_chunks/cli-9d378218.js:11477:3)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/chich/.nvm/versions/node/v16.14.0/lib/node_modules/sanity/node_modules/@sanity/cli/lib/run.js:4:11)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)

@bjoerge
Copy link
Member

bjoerge commented Jan 3, 2023

Thank you for reporting! Just released 3.1.4 that should fix it.

@bjoerge bjoerge closed this as completed Jan 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants