Monday, April 29, 2024
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 573  / 1 Year ago, sun, march 12, 2023, 2:18:01

I need to use npm to install packages redis & moment on my system but it's not happening, I'm getting this instead:



$ npm install redis;npm install moment
/home/ron
└─┬ [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open '/home/ron/package.json'
npm WARN ron No description
npm WARN ron No repository field.
npm WARN ron No README data
npm WARN ron No license field.
/home/ron
├── [email protected]
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open '/home/ron/package.json'
npm WARN ron No description
npm WARN ron No repository field.
npm WARN ron No README data
npm WARN ron No license field.


and I've tried with sudo too but got the same result... How do I fix this?


More From » package-management

 Answers
0

You forgot to run npm init. You have to create package.json file first.



You can find more details here:
https://docs.npmjs.com/creating-a-package-json-file


[#7001] Monday, March 13, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ularousand

Total Points: 380
Total Questions: 109
Total Answers: 101

Location: England
Member since Tue, Sep 8, 2020
4 Years ago
;