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

### Issue: Installation and Execution Error with sindri@latest #146

Closed
SuryaSundarVadali opened this issue Sep 1, 2024 · 4 comments
Closed
Assignees

Comments

@SuryaSundarVadali
Copy link

Description

I encountered several warnings and an error while attempting to install and run the sindri@latest package globally via npm. Below are the details of the commands executed, warnings received, and the error message that occurred.

Commands Executed

  1. Installation Command:

    npm install -g sindri@latest
  2. Check Version Command:

    sindri --version

Warnings Encountered

During the installation process, the following deprecated warnings were displayed:

Error Details

After the installation, when attempting to check the installed version of sindri using the sindri --version command, the following error was encountered:

/mnt/c/Users/vadal/AppData/Roaming/npm/node_modules/sindri/dist/cli/index.js:2
"use strict";var er=Object.create;var pe=Object.defineProperty;var tr=Object.getOwnPropertyDescriptor;var rr=Object.getOwnPropertyNames;var or=Object.getPrototypeOf,ir=Object.prototype.hasOwnProperty;var nr=(t,e)=>{for(var o in e)pe(t,o,{get:e[o],enumerable:!0})},Ge=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of rr(e))!ir.call(t,i)&&i!==o&&pe(t,i,{get:()=>e[i],enumerable:!(n=tr(e,i))||n.enumerable});return t};var y=(t,e,o)=>(o=t!=null?er(or(t)):{},Ge(e||!t||!t.__esModule?pe(o,"default",{value:t,enumerable:!0}):o,t)),sr=t=>Ge(pe({},"__esModule",{value:!0}),t);var $r={};nr($r,{program:()=>Xt});module.exports=sr($r);var ar=()=>typeof document>"u"?new URL("file:"+__filename).href:document.currentScript&&document.currentScript.src||new URL("main.js",document.baseURI).href,w=ar();var Ae=require("process"),Qt=require("@commander-js/extra-typings");var pt=y(require("assert")),Le=y(require("fs")),ut=y(require("path")),j=y(require("process")),mt=require("@commander-js/extra-typings"),dt=y(require("tar"));var ae=require("fs/promises"),ye=y(require("path")),st=y(require("gzip-js")),at=y(require("ignore-walk")),ct=y(require("tar")),lt=y(require("tar-js"));var Z=class{constructor(e){this.config=e}};var de=y(require("axios")),ke=require("axios"),Xe=y(require("@fullstax/p-retry"));var Ye=require("buffer"),Ze=require("formdata-node");var Q=process.env.BROWSER_BUILD?window.File:Ye.File,K=process.env.BROWSER_BUILD?window.FormData:Ze.FormData;var E=class extends Error{url;status;statusText;body;request;constructor(e,o,n){super(n),this.name="ApiError",this.url=o.url,this.status=o.status,this.statusText=o.statusText,this.body=o.body,this.request=e}};var ue=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},X=class{#t;#r;#e;#o;#i;#s;#n;constructor(e){this.#t=!1,this.#r=!1,this.#e=!1,this.#o=[],this.#i=new Promise((o,n)=>{this.#s=o,this.#n=n;let i=a=>{this.#t||this.#r||this.#e||(this.#t=!0,this.#s?.(a))},s=a=>{this.#t||this.#r||this.#e||(this.#r=!0,this.#n?.(a))},c=a=>{this.#t||this.#r||this.#e||this.#o.push(a)};return Object.defineProperty(c,"isResolved",{get:()=>this.#t}),Object.defineProperty(c,"isRejected",{get:()=>this.#r}),Object.defineProperty(c,"isCancelled",{get:()=>this.#e}),e(i,s,c)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,o){return this.#i.then(e,o)}catch(e){return this.#i.catch(e)}finally(e){return this.#i.finally(e)}cancel(){if(!(this.#t||this.#r||this.#e)){if(this.#e=!0,this.#o.length)try{for(let e of this.#o)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.#o.length=0,this.#n?.(new ue("Request aborted"))}}get isCancelled(){return this.#e}};var _e=t=>t!=null,fe=t=>typeof t=="string",Oe=t=>fe(t)&&t!=="",et=t=>typeof t=="object"&&typeof t.type=="string"&&typeof t.stream=="function"&&typeof t.arrayBuffer=="function"&&typeof t.constructor=="function"&&typeof t.constructor.name=="string"&&/^(Blob|File)$/.test(t.constructor.name)&&/^(Blob|File)$/.test(t[Symbol.toStringTag]),cr=t=>t instanceof K,lr=t=>t>=200&&t<300,pr=t=>{try{return btoa(t)}catch{return Buffer.from(t).toString("base64")}},ur=t=>{let e=[],o=(i,s)=>{e.push(`${encodeURIComponent(i)}=${encodeURIComponent(String(s))}`)},n=(i,s)=>{_e(s)&&(Array.isArray(s)?s.forEach(c=>{n(i,c)}):typeof s=="object"?Object.entries(s).forEach(([c,a])=>{n(`${i}[${c}]`,a)}):o(i,s))};return Object.entries(t).forEach(([i,s])=>{n(i,s)}),e.length>0?`?${e.join("&")}`:""},mr=(t,e)=>{let o=t.ENCODE_PATH||encodeURI,n=e.url.replace("{api-version}",t.VERSION).replace(/{(.*?)}/g,(s,c)=>e.path?.hasOwnProperty(c)?o(String(e.path[c])):s),i=`${t.BASE}${n}`;return e.query?`${i}${ur(e.query)}`:i},dr=t=>{if(t.formData){if(t.formData instanceof K)return t.formData;let e=new K,o=(n,i)=>{fe(i)||et(i)?e.append(n,i):e.append(n,JSON.stringify(i))};return Object.entries(t.formData).filter(([n,i])=>_e(i)).forEach(([n,i])=>{Array.isArray(i)?i.forEach(s=>o(n,s)):o(n,i)}),e}},me=async(t,e)=>typeof e=="function"?e(t):e,fr=async(t,e,o)=>{let n=await me(e,t.TOKEN),i=await me(e,t.USERNAME),s=await me(e,t.PASSWORD),c=await me(e,t.HEADERS),a=o&&"getHeaders"in o&&typeof o?.getHeaders=="function"&&o?.getHeaders()||{},f=Object.entries({Accept:"application/json",...c,...e.headers,...a}).filter(([p,u])=>_e(u)).reduce((p,[u,d])=>({...p,[u]:String(d)}),{});if(Oe(n)&&(f.Authorization=`Bearer ${n}`),Oe(i)&&Oe(s)){let p=pr(`${i}:${s}`);f.Authorization=`Basic ${p}`}return e.body&&(e.mediaType?f["Content-Type"]=e.mediaType:et(e.body)?f["Content-Type"]=e.body.type||"application/octet-stream":fe(e.body)?f["Content-Type"]="text/plain":cr(e.body)||(f["Content-Type"]="application/json")),f},gr=t=>{if(t.body)return t.body},Qe=t=>!!(de.default.isAxiosError(t)&&(t.response?.status&&[502,503,504].includes(t.response.status)||t.code&&["ECONNREFUSED","ECONNRESET","ENOTFOUND","ENETUNREACH",ke.AxiosError.ECONNABORTED,ke.AxiosError.ERR_NETWORK].includes(t.code))),hr=async(t,e,o,n,i,s,c,a)=>{let f=de.default.CancelToken.source(),p={url:o,headers:s,data:n??i,method:e.method,withCredentials:t.WITH_CREDENTIALS,cancelToken:f
@sangaline
Copy link
Contributor

What node version are you running (node --version) and what operating system? Was there any any other output with a specific error message?

Note that the warnings aren't for runtime dependencies, these are only used during installation for the patch-package postinstall hook. We're using the latest v8.0.0 release, but their dependencies are outdated. I can look into specifying overrides to use more recent versions and eliminate these warnings. I don't think this is relevant to the error you're seeing however.

@SuryaSundarVadali
Copy link
Author


Node Version:

v12.22.9

Command:

sindri login

Error:

When running the command, the following error occurs:

npm ERR! code ERR_INVALID_URL
npm ERR! Invalid URL

Additional Details:

When attempting to run the command using npx:

npx sindri@latest login

I encounter the same error.

Log File:

A complete log of this run can be found here:

C:\Users\vadal\AppData\Local\npm-cache\_logs\2024-09-04T04_58_07_772Z-debug-0.log

@sangaline
Copy link
Contributor

We target compatibility with currently maintained Node releases (see Node.js Releases), and our current testing matrix is for versions 18, 19, 20, 21, and 22. Node v12 was end-of-lifed in 2022 and no longer gets security updates, so I'd highly recommend updating to a more recent version in general. Any version since v18 should be compatible. I recommend using a node version manager such as nvm, fnm, n, or asdf to manage your node installation and switch versions easily.

Windows compatibility outside of WSL is relatively untested at this point. The /mnt/c/Users/ path in your initial post looks like it was from within WSL, and that should work fine. Running outside of WSL will likely result in errors, but we would be happy to address any issues that come up there if you want to go that route. You'll encounter less friction using WSL though.

Both of these points should be made more clear in the README, I'll keep the issue open until we've made those additions. Let me know if you run into more problems; I suspect it will work with node >=v18 and WSL.

@SuryaSundarVadali
Copy link
Author

Thanks a lot updating node version had worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants