npm 在 macOS 上将“^”替换为“/Users/myusername”

npm replaces "^" with "/Users/myusername" on macOS

每当我安装 npm 包时,它不会像 "co-body": "^4.2.0" 这样显示,而是像 "co-body": "/Users/username4.2.0 这样添加".

我在 macOS Sierra 上使用最新版本的 npm (3.10.8)。

您需要使用:npm config set save-prefix "^".