更新时间:2021-12-03 10:05:14
我也遇到了这个问题,这让我发疯。
I had this problem as well, and it was driving me crazy.
最终解决的问题是运行 npm init
。这给我的package.json添加了很多东西,但是随后-save-dev
可以正常工作。即使我删除了 npm init
添加的所有新内容之后,-save-dev
仍然有效。
What finally fixed it was running npm init
. This added a bunch of stuff to my package.json, but afterwards --save-dev
worked as expected. Even after I removed all the new stuff added by npm init
, --save-dev
still worked.