0

How can I generate a package.lock.json via the command line? I tried to run npm install, npm update, npm ci, npm ci --production. Everything failed. Usually a npm install do the job. I also tried the promising npm install --package-lock without success.

I want one to have one in local so I could push it to the build in my ci.

extract of my local debug.log:

14 verbose Windows_NT 10.0.17134
15 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Windows\\System32\\node_modules\\npm\\bin\\npm-cli.js" "ci" "--production"
16 verbose node v12.16.1
17 verbose npm  v6.14.4
18 error cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.
19 verbose exit [ 1, true ]

gitlab's output:

Running with gitlab-runner 13.1.0 (6214287e)
  on docker-auto-scale fa6cab46
Preparing the "docker+machine" executor
00:40
Using Docker executor with image node:latest ...
Pulling docker image node:latest ...
Using docker image sha256:37ad18cd8bd1f0b80ea0ee380a7addda75f51e0b30cf1a03934d20ea16a905d9 for node:latest ...
Preparing environment
00:04
Running on runner-fa6cab46-project-19785321-concurrent-0 via runner-fa6cab46-srm-1594037028-15e9cfed...
Getting source from Git repository
00:01
$ eval "$CI_PRE_CLONE_SCRIPT"
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/aloisdegouvello/posxtkarto/.git/
Created fresh repository.
Checking out fc5855e5 as master...
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:01
$ npm ci
npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-07-06T12_05_18_266Z-debug.log
ERROR: Job failed: exit code 1

You can see the failed job on Gitlab.

The gitlab-ci.yml used is the one from the vuejs's official documentation. The vuejs code was originally written on https://codesandbox.io.

As far as I know, my node, my npm and my OS (Windows) up to date.

aloisdg
  • 16,342
  • 4
  • 73
  • 80

0 Answers0