How to recover package.json from node_modules directory
up vote
1
down vote
favorite
I deleted the package.json
in mistake but I have package-lock.json
and node_modules
directory and when I give the project files to my coworker he will get some errors when he wants to use gulp
(because I use Macbook and my coworker uses Windows). So I think he should install all node_modules
in his machine.
Is there any way to create package.json from package-lock.json
or node_modules
directory?
node.js npm package.json
add a comment |
up vote
1
down vote
favorite
I deleted the package.json
in mistake but I have package-lock.json
and node_modules
directory and when I give the project files to my coworker he will get some errors when he wants to use gulp
(because I use Macbook and my coworker uses Windows). So I think he should install all node_modules
in his machine.
Is there any way to create package.json from package-lock.json
or node_modules
directory?
node.js npm package.json
2
Well the lesson here is this is why you use source control. Fortunately you would be able to obtain "some" of the data from thepackage-lock.json
, but it's not everything. Any scripts or metadata would be lost. I would suggest learning git or similar as a priority. Or do you actually have git or similar enabled?
– Neil Lunn
Nov 19 at 9:19
@NeilLunn Thank you for your comment, yes I usegit
in my projects but this project was for a previous developer and they have given me this project to continue But I do not remember that I removed thepackage.json
or that it did not exist from the beginning
– MajAfy
Nov 19 at 9:23
First off did you check to make sure that it's not in your recycle bin (or trash I think is what it's called on mac)? Also you could probably manually install them all going through the node_modules one by one and the package.json, but it's pretty tedious.
– jgerstle
Nov 19 at 9:23
Well wer're pretty much checking down the options since "rebuilding" apackage.json
based onpackage-lock.json
is a process you need to create. It's not like it's "built into npm" or anything like that. Sogit
or "Recycle Bin" would be the most conveinent methods. And like I said, there's other data inpackage.json
that is not listed inpackage-lock.json
. The big difference being "dependencies" vs "devDependencies" as the "lock" does not distinguish between the two
– Neil Lunn
Nov 19 at 9:34
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I deleted the package.json
in mistake but I have package-lock.json
and node_modules
directory and when I give the project files to my coworker he will get some errors when he wants to use gulp
(because I use Macbook and my coworker uses Windows). So I think he should install all node_modules
in his machine.
Is there any way to create package.json from package-lock.json
or node_modules
directory?
node.js npm package.json
I deleted the package.json
in mistake but I have package-lock.json
and node_modules
directory and when I give the project files to my coworker he will get some errors when he wants to use gulp
(because I use Macbook and my coworker uses Windows). So I think he should install all node_modules
in his machine.
Is there any way to create package.json from package-lock.json
or node_modules
directory?
node.js npm package.json
node.js npm package.json
asked Nov 19 at 9:15
MajAfy
1,19452960
1,19452960
2
Well the lesson here is this is why you use source control. Fortunately you would be able to obtain "some" of the data from thepackage-lock.json
, but it's not everything. Any scripts or metadata would be lost. I would suggest learning git or similar as a priority. Or do you actually have git or similar enabled?
– Neil Lunn
Nov 19 at 9:19
@NeilLunn Thank you for your comment, yes I usegit
in my projects but this project was for a previous developer and they have given me this project to continue But I do not remember that I removed thepackage.json
or that it did not exist from the beginning
– MajAfy
Nov 19 at 9:23
First off did you check to make sure that it's not in your recycle bin (or trash I think is what it's called on mac)? Also you could probably manually install them all going through the node_modules one by one and the package.json, but it's pretty tedious.
– jgerstle
Nov 19 at 9:23
Well wer're pretty much checking down the options since "rebuilding" apackage.json
based onpackage-lock.json
is a process you need to create. It's not like it's "built into npm" or anything like that. Sogit
or "Recycle Bin" would be the most conveinent methods. And like I said, there's other data inpackage.json
that is not listed inpackage-lock.json
. The big difference being "dependencies" vs "devDependencies" as the "lock" does not distinguish between the two
– Neil Lunn
Nov 19 at 9:34
add a comment |
2
Well the lesson here is this is why you use source control. Fortunately you would be able to obtain "some" of the data from thepackage-lock.json
, but it's not everything. Any scripts or metadata would be lost. I would suggest learning git or similar as a priority. Or do you actually have git or similar enabled?
– Neil Lunn
Nov 19 at 9:19
@NeilLunn Thank you for your comment, yes I usegit
in my projects but this project was for a previous developer and they have given me this project to continue But I do not remember that I removed thepackage.json
or that it did not exist from the beginning
– MajAfy
Nov 19 at 9:23
First off did you check to make sure that it's not in your recycle bin (or trash I think is what it's called on mac)? Also you could probably manually install them all going through the node_modules one by one and the package.json, but it's pretty tedious.
– jgerstle
Nov 19 at 9:23
Well wer're pretty much checking down the options since "rebuilding" apackage.json
based onpackage-lock.json
is a process you need to create. It's not like it's "built into npm" or anything like that. Sogit
or "Recycle Bin" would be the most conveinent methods. And like I said, there's other data inpackage.json
that is not listed inpackage-lock.json
. The big difference being "dependencies" vs "devDependencies" as the "lock" does not distinguish between the two
– Neil Lunn
Nov 19 at 9:34
2
2
Well the lesson here is this is why you use source control. Fortunately you would be able to obtain "some" of the data from the
package-lock.json
, but it's not everything. Any scripts or metadata would be lost. I would suggest learning git or similar as a priority. Or do you actually have git or similar enabled?– Neil Lunn
Nov 19 at 9:19
Well the lesson here is this is why you use source control. Fortunately you would be able to obtain "some" of the data from the
package-lock.json
, but it's not everything. Any scripts or metadata would be lost. I would suggest learning git or similar as a priority. Or do you actually have git or similar enabled?– Neil Lunn
Nov 19 at 9:19
@NeilLunn Thank you for your comment, yes I use
git
in my projects but this project was for a previous developer and they have given me this project to continue But I do not remember that I removed the package.json
or that it did not exist from the beginning– MajAfy
Nov 19 at 9:23
@NeilLunn Thank you for your comment, yes I use
git
in my projects but this project was for a previous developer and they have given me this project to continue But I do not remember that I removed the package.json
or that it did not exist from the beginning– MajAfy
Nov 19 at 9:23
First off did you check to make sure that it's not in your recycle bin (or trash I think is what it's called on mac)? Also you could probably manually install them all going through the node_modules one by one and the package.json, but it's pretty tedious.
– jgerstle
Nov 19 at 9:23
First off did you check to make sure that it's not in your recycle bin (or trash I think is what it's called on mac)? Also you could probably manually install them all going through the node_modules one by one and the package.json, but it's pretty tedious.
– jgerstle
Nov 19 at 9:23
Well wer're pretty much checking down the options since "rebuilding" a
package.json
based on package-lock.json
is a process you need to create. It's not like it's "built into npm" or anything like that. So git
or "Recycle Bin" would be the most conveinent methods. And like I said, there's other data in package.json
that is not listed in package-lock.json
. The big difference being "dependencies" vs "devDependencies" as the "lock" does not distinguish between the two– Neil Lunn
Nov 19 at 9:34
Well wer're pretty much checking down the options since "rebuilding" a
package.json
based on package-lock.json
is a process you need to create. It's not like it's "built into npm" or anything like that. So git
or "Recycle Bin" would be the most conveinent methods. And like I said, there's other data in package.json
that is not listed in package-lock.json
. The big difference being "dependencies" vs "devDependencies" as the "lock" does not distinguish between the two– Neil Lunn
Nov 19 at 9:34
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371458%2fhow-to-recover-package-json-from-node-modules-directory%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
Well the lesson here is this is why you use source control. Fortunately you would be able to obtain "some" of the data from the
package-lock.json
, but it's not everything. Any scripts or metadata would be lost. I would suggest learning git or similar as a priority. Or do you actually have git or similar enabled?– Neil Lunn
Nov 19 at 9:19
@NeilLunn Thank you for your comment, yes I use
git
in my projects but this project was for a previous developer and they have given me this project to continue But I do not remember that I removed thepackage.json
or that it did not exist from the beginning– MajAfy
Nov 19 at 9:23
First off did you check to make sure that it's not in your recycle bin (or trash I think is what it's called on mac)? Also you could probably manually install them all going through the node_modules one by one and the package.json, but it's pretty tedious.
– jgerstle
Nov 19 at 9:23
Well wer're pretty much checking down the options since "rebuilding" a
package.json
based onpackage-lock.json
is a process you need to create. It's not like it's "built into npm" or anything like that. Sogit
or "Recycle Bin" would be the most conveinent methods. And like I said, there's other data inpackage.json
that is not listed inpackage-lock.json
. The big difference being "dependencies" vs "devDependencies" as the "lock" does not distinguish between the two– Neil Lunn
Nov 19 at 9:34