一、NPM
1.查詢 npm 安裝依賴的全局路徑
npm prefix -g
2. 修改 npm 全局安裝位置
npm config set prefix "D:\nodejs\node_modules\npm\node_modules"
3. 修改 npm 全局 cache 位置
npm config set cache "D:\nodejs\node_modules\npm\cache"
4. npm 修改后依賴安裝
二、YARN
1. 查詢 yarn 安裝依賴的全局路徑
yarn global bin
2. 修改 yarn 全局 bin 位置
yarn config set prefix "D:\nodejs\node_modules\yarn\bin"
3. 修改 yarn 全局安裝位置
yarn config set global-folder "D:\nodejs\node_modules\yarn\node_modules"
4. 修改 yarn 全局 cache 位置
yarn config set cache-folder "D:\nodejs\node_modules\yarn\cache"
5. 修改 yarn 全局 link 位置
yarn config set link-folder "D:\nodejs\node_modules\yarn\datalink"
6.修改后依賴安裝
文章來源地址http://www.zghlxwxcb.cn/news/detail-644131.html
文章來源:http://www.zghlxwxcb.cn/news/detail-644131.html
到了這里,關(guān)于查詢 npm/yarn 安裝依賴的全局路徑及路徑修改的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!