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?










share|improve this question


















  • 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
    yesterday










  • @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
    yesterday










  • 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
    yesterday












  • 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
    yesterday

















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?










share|improve this question


















  • 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
    yesterday










  • @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
    yesterday










  • 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
    yesterday












  • 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
    yesterday















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?










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked yesterday









MajAfy

1,19452959




1,19452959








  • 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
    yesterday










  • @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
    yesterday










  • 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
    yesterday












  • 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
    yesterday
















  • 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
    yesterday










  • @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
    yesterday










  • 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
    yesterday












  • 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
    yesterday










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
yesterday




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
yesterday












@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
yesterday




@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
yesterday












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
yesterday






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
yesterday














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
yesterday






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
yesterday



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














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





















































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







Popular posts from this blog

Cypress Hill

what are some tips for doing well in the interview? [on hold]

How does a super-power salesman not get shut down for legal reasons?