ui5experts / ui5-schemas

:rocket: UI5 Schemas allows you to develop SAPUI5/OpenUI5 XML at a maximum convenience. It downloads, upgrades and sets up SAPUI5/OpenUI5 XML schemas for a better development experience in your favorite IDE (if it is WebStorm ;).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Something went all wrong while downloading the schema files!

michal-majer opened this issue · comments

Hi,

I have the error during installation of ui5-schemas.
I also tried to perform the installation with parameter -v 1.44.24 but error is still the same.

Could You help? :)

ui5-schemas error

Hey,

what does

echo %APPDATA%
ui5-schemas --debug

say?

BR
Chris

Same Error here.

Output for echo %APPDATA%:
C:\Users\Mmachaue\AppData\Roaming

And Output for ui5-schemas --debug:
capture

BR
Marc

Getting the same error, running in cmd, with the following statement: npx ui5-schemas

Error: C:\project\C:\Users\<username>\AppData\Roaming\UI5Experts\ui5-schemas contains invalid WIN32 path characters.

Why is it concatenating the path like that?

Trying this out with:

node -v = v9.3.0
npm -v = 5.5.1
windows 7 pro

When running the command with the debug flag: npx ui5-schemas --debug

npx: installed 1 in 2.449s
The "path" argument must be of type string
C:\project\npm-config\npm\node_modules\ui5-schemas\bin\index.js
ui5-schemas info Preparing 'sapui5' schemas in version 'latest'...
ui5-schemas debug [download] Downloading all libraries metafile from 'https://sa
pui5.hana.ondemand.com/discovery/all_libs'
ui5-schemas error Damn... Something went all wrong while downloading the schema
files!
ui5-schemas error Are you sure the version '' is still available on 'sapui5' dow
nload pages?
ui5-schemas error { Error: C:\Users\<username>\AppData\Roaming\C:\Users\<username>\App
Data\Roaming\UI5Experts\ui5-schemas contains invalid WIN32 path characters.
    at Object.mkdirsSync (C:\project\npm-config\npm\node_modules\ui5-schemas\node_m
odules\fs-extra\lib\mkdirs\mkdirs-sync.js:18:22)
    at Object.emptyDirSync (C:\project\npm-config\npm\node_modules\ui5-schemas\node
_modules\fs-extra\lib\empty\index.js:34:18)
    at Object.schemas (C:\project\npm-config\npm\node_modules\ui5-schemas\lib\downl
oad.js:46:6)
    at download.allLibsFile.then (C:\project\npm-config\npm\node_modules\ui5-schema
s\bin\index.js:62:18)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7) code: 'EINVAL
' }

@cschuff
I have found the issues for us, windows (7 pro/10 pro) users, in the lib\download.js file line 46:

fs.emptyDirSync(path.join(process.cwd(), options.outputDir, options.version));

When I remove process.cwd(), it works.

fs.emptyDirSync(path.join(options.outputDir, options.version));

Why is that needed (something *nix OS needed)?
Also I think it's better to fix the version in the package.json file, I had some situation where sem ver was not really followed. What do you think?

npm run test is fine, I can create a pull request if you want with the javascript fix and create a different issue/pull request to assure the versions are fixed (without prefix, ~ or ^) in the package.json file?

And we need to create some real test in the near future ;).

@michal-majer and @mmachauerjs
What kind of windows versions do you have? Windows 10 (pro)?

@xtreemrage Thanks for the investigation work. I will fix this as soon as possible. If you want to speed up things feel free to open a pull request.

@xtreemrage What is the problem with the semver version resp. package.json? I don't want to have fixed dependencies in there. That's what the package-lock.json is for (in npm5). Or did I miss something here?

I'm in the middle of a bigger refactoring towards a 1.0 anyways that will surely contain tests. But I don't have a release date yet :)

@cschuff
I will try to create a pull request today, if time let's me.

@cschuff
Well there was a bug in from 5.1.0 till ~5.6.0 (not sure where it is solved) that modified the package-lock.json (with npm 5.5.1 it still changes).

Nice, I'm looking forward to v1.0. If you need some help, regarding reviews or some, let me know.

Hey folks,

finally published 0.3.1 including @xtreemrage bugfix. Thanks again.

HF
Chris