npm命令集合(npm publish等)

 前言:npm命令每次网上查询,最好还是搜集起来。

 

 

 

 

 

3,镜像源切换

// npm设置新淘宝源
npm config set registry https://registry.npmmirror.com
npm config set registry https://registry.npm.taobao.org // npm设置回本源 npm config set registry https://registry.npmjs.org

 

2,npm install 问题{ Error: EACCES: permission denied, mkdir }

处理方案:
1) 在命令结尾加 --unsafe-perm: npm install --unsafe-perm
2) 或者在package.json中添加:
"config": {
"unsafe-perm":true
}

 

1,发布 npm publish

如果出现了

npm ERR! publish Failed PUT 402
npm ERR! code E402
npm ERR! You must sign up for private packages : @okexchain/javascript-sdk-qrcode

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/path/.npm/_logs/2021-02-01T03_36_47_300Z-debug.log

则:

npm publish --access=public

 

posted @ 2020-10-16 11:20  走走停停走走  Views(223)  Comments(0)    收藏  举报