admin管理员组文章数量:1402850
While in the process of updating an Angular app I and colleagues are working on, I ended up running "npm update" when I meant to run "npm install". Doing so led me on a bit of a rabbit trail because of course now all my dependencies - AND their dependencies got updated in the process. From there I had to resolve certain conflicts to get the new versions to work correctly. However, this also led me to a point where a bug in one of those dependencies is preventing my app from booting up. According to the the Angular github repo, the issue is being worked on.
My question is, how can I revert to my previous setup in the meantime? I tried copy and pasting the package.json file as it originally existed before my "npm update", deleting my "node modules" folder, and running "npm install" again. But this doesn't resolve the issue. Is there a way I can be assured of reverting to my previous working setup?
While in the process of updating an Angular app I and colleagues are working on, I ended up running "npm update" when I meant to run "npm install". Doing so led me on a bit of a rabbit trail because of course now all my dependencies - AND their dependencies got updated in the process. From there I had to resolve certain conflicts to get the new versions to work correctly. However, this also led me to a point where a bug in one of those dependencies is preventing my app from booting up. According to the the Angular github repo, the issue is being worked on.
My question is, how can I revert to my previous setup in the meantime? I tried copy and pasting the package.json file as it originally existed before my "npm update", deleting my "node modules" folder, and running "npm install" again. But this doesn't resolve the issue. Is there a way I can be assured of reverting to my previous working setup?
Share Improve this question asked May 2, 2017 at 16:06 ReyRey 1,4332 gold badges17 silver badges32 bronze badges1 Answer
Reset to default 7The process you described should work:
- Get an old copy of your
package.json
from your repository at the state you know it worked - Run
rm -rf node_modules
to remove thenode_modules
folder - Run
npm install
to install again
If that didn't work, verify that you:
- are in the correct directory (that should contain
package.json
andnode_modules
) - have permissions to clean the
node_modules
folder (chmod 777 node_modules
) - the
package.json
that is written in the file system is actually the restored one (sometimes an IDE or Git can create a weird shadow copy where you think it's one way, but it's really another). You can tell this by usingcat package.json
and inspecting the output
本文标签: javascriptReverting to Previous Version of Packagejson When a Dependency Bug ArisesStack Overflow
版权声明:本文标题:javascript - Reverting to Previous Version of Package.json When a Dependency Bug Arises - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744327225a2600786.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论