-1

I want to setup the apache-age viewer with npm but when i execute the command npm run setup it gives me the following error.


> ag-viewer@0.0.1 setup-front /home/Desktop/age-viewer
> cd frontend && npm install

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm ERR! Object for dependency "globals" is empty.
npm ERR! Something went wrong. Regenerate the package-lock.json with "npm install".
npm ERR! If using a shrinkwrap, regenerate with "npm shrinkwrap".

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2023-05-04T09_33_17_778Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ag-viewer@0.0.1 setup-front: `cd frontend && npm install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ag-viewer@0.0.1 setup-front script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2023-05-04T09_33_17_843Z-debug.log
ERROR: "setup-front" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ag-viewer@0.0.1 setup: `npm install && npm-run-all setup-front setup-backend`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ag-viewer@0.0.1 setup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2023-05-04T09_33_17_911Z-debug.log

Can anyone provide guidance on what might be going wrong and how to fix it?

Mohsin
  • 3
  • 2

7 Answers7

1

The error message indicates that there was a problem with the npm install command inside the setup-front script of the ag-viewer project. The error specifically means that there is already 'package-lock.json' and you need to regenerate it. Try the following command to solve the issue

cd /home/Desktop/age-viewer/frontend
rm package-lock.json
npm install

Once you remove it now when you run the npm run setup it will solve the issue.

ShaHeen
  • 59
  • 5
0

You can try deleting package-lock and the node modules (if the folder exists) and try again

0

There is probably a problem with the npm command. So, try running:

npm cache clean --force
npm install
npm run setup

If the above doesn't work, you can do this manually by deleting the node_modules and package-lock.json file and run npm run setup again.

Make sure that you have latest version of npm installed.

npm install -g npm
Safi50
  • 379
  • 1
  • 7
0

Open your terminal and navigate to your project directory using "cd" command. Run this command

'rm -rf node_modules' to remove node_modules folder.

Now run this command npm install to reinstall node_modules

If error came again then try running npm cache clean --force

If again error then share your snapshot of logs at /home/.npm/_logs/

farrukh raja
  • 187
  • 4
0

You can just remove the package-lock.json file and run again the npm -i command

Marcos Silva
  • 115
  • 5
0

delete node module file and .lockjson file then run these commands in terminal hopefully this will resolve your issue

npm cache clean --force
npm install
npm run setup
-1

It seems that the error has occurred due to an issue with the npm install command. Try following these steps: Navigate to the front end directory of the age-viewer project:

cd /home/Desktop/age-viewer/frontend

Path may vary depending upon actual location on your device.

Next delete the package-lock.json file:

rm package-lock.json

Then, install the dependencies of project again using the command npm install

Now go back to the root directory of your project

cd /home/Desktop/age-viewer

This path can also vary depending on where the project is installed.

Finally run the command

 npm run setup

Hopefully it will resolve the issue.