cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

XSA: Configure error. Node js module failed on build

Former Member
0 Likes
2,870

Hi All,

I have created a simple node.js module in HANA 2.0 SPS04, When i try to build it it get failed. I don't understand why it failed.

Error is

P.S : I don't have CLI tool so i don't know if by default it is creating defining right versions in Package.json, If there is any other way to find the version like by some sql statement let me know.

but as much i know about node js if give "^" symbol before version it automatically pickup latest version, That's why not sure what is the problem, Kindly HELP!!

Here is my package.json

and here is my server.js

my MTA.yaml looks like


Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Likes

The issue was already discussed here.

You set already node version 10.x. The module @sap/xsjs-test must be set to at least 3.1.2.

Former Member
0 Likes

Thanks Florian,

I tried the solution here is the error i am getting after changing the version as "@sap/xsjs-test": "^3.1.2"


The final solution that marked as green in the answer you shared is that they have removed below code, But in my case if i removed this code I will not get the values of $.session.getUsername() as you mentioned in another post of yours.

 "devDependencies": {
    "@sap/xsjs-test": "^3.0.2"
  },
"test": "node testrun.js"

I think i will ask my Basis team to update the versions of these modules

From node module Package.json
"@sap/xsjs-test": "3.0.2"

From DB module Package.json

"@sap/hdi-deploy": "3.10.0"

Kindly correct me if i am wrong.

pfefferf
Active Contributor

I guess you get that error, because your XSA local NPM repo does not container a newer version. As you said you can try to update it in your local NPM repo or you set the UPSTREAM_LINK to https://registry.npmjs.org. All @sap npm modules are available there too (due to the migration from npm.sap.com).

Former Member
0 Likes

Hi florian.pfeffer ,

My basis team updated the version of "@sap/xsjs-test" to "6.14.4"

but even though i am getting the same error

pfefferf
Active Contributor

Don't know what they updated, but at least not @sap/xsjs-test, because for that module the latest version is 3.1.3 (you can check that with command "npm view @sap/xsjs-test versions".

Former Member
0 Likes

Thanks florian.pfeffer , I think adding local package might work for me, but i dont have any idea where to add it in which file,can you please share any example...

Do i need CLI tool to do it or adding in the file and building node module can work?

pfefferf
Active Contributor
0 Likes

With "local" I do not mean your local workstation or so. I mean the npm registry in your XSA installation (di-local-npm-registry). I don't know how that can be updated (I guess it is not possible w/o updating XSA itself). Setting the upstream link would be much more easier from my point of view.

Former Member
0 Likes

Hi florian.pfeffer Can you please help me in which file of the project under WebIde i will use UPSTREAM link and how, I don't have CLI tool, I think you are saying it can be done somewhere locally.

pfefferf
Active Contributor
0 Likes

Please check the linked documentation, there is everything explained.

Former Member
0 Likes

Hi florian.pfeffer, I am not sure which linked documentation you are talking about, the above link which you provided in first answer is blog post where solution marked as right is the one suggesting to remove dev dependencies from package.json file.

In my case i cant do it because i need $.Session variable to work

If we remove dev dependencies according to your one of the the answer we can't fetch the values.

Can you please let me know in which file i can add UPSTREAM link in my project in webide pleaseee.

pfefferf
Active Contributor
0 Likes

The link is already in the comments above (UPSTREAM_LINK). Was posted 5 days ago. Seems that you do not read carefully what is written.

Former Member
0 Likes

Hi florian.pfeffer i read that link and it's talking about .mtaext and .npmrc file, I don't found any of these files in my webide, That's why i was asking where i have look for these files