npm config set tarball 错误:无效选项 | 使用 package.json 设置本地包路径
The npm config set command is used to set npm configuration options. The 'tarball' option you are trying to use is not a valid npm option.
If you want to set the tarball for a specific package, you can do it by specifying the 'tarball' property in the package.json file of that package. For example:
"tarball": "file:./path/to/local/tarball/node-v8.9.4-headers.tar.gz"
Make sure to replace ./path/to/local/tarball with the actual path to your local tarball file.
If you want to set the tarball for all packages installed by npm, you can use the --cache option to specify a local npm cache directory where the tarball is located. For example:
npm install --cache=./path/to/local/tarball
Again, replace ./path/to/local/tarball with the actual path to your local tarball file.
Note that the --cache option is used to specify a cache directory for npm, and it will look for packages in that cache first before trying to download them from the registry.
原文地址: https://www.cveoy.top/t/topic/o5Ja 著作权归作者所有。请勿转载和采集!