cancel
Showing results for 
Search instead for 
Did you mean: 

I have created a trial account, when I try the first exercise I get the error npm ci command fails

damovand
Product and Topic Expert
Product and Topic Expert
0 Kudos

Why is package-lock.json missing?  I have setup a free account on SAP BTP trial for the tutorials.  Everything checks out until I get to the step in the Exercise.  Do I need to have free tier service instead?

npm ci command fails with the following error:

36 verbose stack The `npm ci` command can only install with an existing package-lock.json or

36 verbose stack npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or

36 verbose stack later to generate a package-lock.json file, then try again.

36 verbose stack

Margit_Wagner
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @damovand
To help us to understand your query better, could you please provide the following information in your correspondence?
•          URL of the exercise or SAP Learning Journey you are referring to
Kind regards
Margit

 

View Entire Topic
jannes_schofeld
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @dhrubajyoti @Jarmo_Tuominen ,

unfortunately I cannot reproduce the issue. I have adjusted the instructions, can you try to execute these adjusted instructions?

  • remove package-lock.json file from your project

  • create a file .npmrc in the directory where the package.json resides
  • add following line into the .npmrc file 
    registry=https://registry.npmjs.com/
  • run command npm install in the terminal within the root directory of your project (where the package.json file resides)
  • try to do the cf push again
  • let us know the results

I took inspiration from the following question in the community https://answers.sap.com/questions/13544661/how-to-avoid-changes-in-package-lockjson-when-usin.html , but unfortunately as said cannot reproduce the issue myself.

Thanks and best regards,

Jannes

Tiwari
Explorer
0 Kudos
deleted package-lock.json and then created file .npmrc in the same directory where package.json resides. then ran npm install and then CF PUSH.. but again same error..
Tiwari
Explorer
0 Kudos
I had even tried replacing content http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/ from package-lock.json with this URL. but, still it did'nt work.
Tiwari
Explorer
0 Kudos
someone has suggested on stackoverflow - npm config set proxy http://domain:8080 but, I am not sure as how to try this 😞
Tiwari
Explorer
0 Kudos

I may be wrong but the URL ( http://nginx-redirector.repo-cache.svc.cluster.local/repository/appstudio-npm-group/) may be causing this. this may be locally accessible from SAP network but not from outside. This is just a vague thought. I tried opening this link and it says that it is not reachable. this URL is generated in package-lock.json file.

Tiwari
Explorer
0 Kudos
i also added "engines": { "node": "16.11.1", "npm": "8.0.0" } in package.json but no luck 😞
Tiwari
Explorer
0 Kudos
Sorry Jannes .. I know it would be difficult for you as you are not able to reproduce this issue. I am also trying different options to check and let you know so that something can trigger some thoughts which could be helpful for us facing this issue. Thanks
Tiwari
Explorer
0 Kudos

i tried command- "npm help config"    result --- npm ERR! code ENOENT npm ERR! syscall spawn man npm ERR! path man npm ERR! errno -2 npm ERR! enoent spawn man ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in: npm ERR! /home/user/.npm/_logs/2022-03-30T16_44_12_569Z-debug-0.log

jannes_schofeld
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @Tiwari,

thanks for your efforts and for keeping us informed. Could you please try to run command

npm ci

instead of the npm i or npm install? npm ci is doing a clean install of all dependencies, e.g. removing all existing node modules before installing them again.

Best regards,

Jannes

Tiwari
Explorer
0 Kudos
Hi Jannes.. npm ci is throwing error if we remove package-lock.json. i ran npm install first and the ran npm ci. after that, i ran cf push but i am still getting the same error.
Tiwari
Explorer
0 Kudos
@Jannes - I tried npm help config command --- getting below error - npm help config npm ERR! code ENOENT npm ERR! syscall spawn man npm ERR! path man npm ERR! errno -2 npm ERR! enoent spawn man ENOENT npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent npm ERR! A complete log of this run can be found in.. I am not sure if you can get any clue with this error. Thanks for your help!