vsce package 后出现 Command failed: npm list --production --parseable --depth=99999 --loglevel=error 。missing: vsce@^2.10.0, required by my-flask-snippets@0.0.1
说明,我是在尝试打包VScode插件时弹出这个错误
我在网上搜索资料发现 Command failed: npm list --production --parseable --depth=99999 --loglevel=error
很多情况都可能导致这个错误。请大家注意甄别情况。
原因
经过我排除发现,我出现这个错误的原因时因为我一开始安装 vsce
包时是当前位置安装,后面我觉得不妥就改为全局安装。然后错误的操作来了,我没有卸载当前位置安装的 vsce, 而是直接删除了node_modules 文件夹
。 就是没有卸载再删除,导致 vsce package
命令不能正确执行,从而出现错误。
解决方法
重新在当前位置安装 vsce
包,npm install vsce
,
使用 npm uninstall vsce
卸载。
最后可以选择删除 node_modules
文件夹。