常用npm命令:https://www.runoob.com/nodejs/nodejs-npm.html
npm文档:
错误1: ERR: Please try running this command again as root/Administrator
说明: 提示要用管理员身份重新安装,网上有说要清除缓存,尝试了行不通。
或者登录用户(尝试了有时候可以)再重新安装
>npm login
Username: test
Password: ******
Email: *******
>npm install --save module
tip:登录之后安装还是报错的话,就多试几次,网络差的情况下也有可能导致安装失败。(错误提示就是让你重新安装)
错误2: ERR! network ‘proxy’ config is set properly
原文错误翻译: 如果有代理就把代理配置正确。
>npm config set proxy null
>npm config set https-proxy null
把这两个代理都设置设为null 就可以了。
也可以找到配置文件.npmrc 中进行修改。
错误3: npm publish
ERR! You cannot publish over the previously published versions
err:您不能在以前发布的版本上发布。 每次发布都要修改版本号,要修改version
npm config get registry // 查看
npm config set registry=http://registry.npmjs.org // npm镜像
npm config set registry=https://registry.npm.taobao.org/ // 淘宝镜像
npm config list //查看配置可以看到配置目录: userconfig C:\Users\Administrator\.npmrc
如果当前是淘宝镜像发布是发布不成功的
再进行发布。 要确定是登录的状态下呦。
错误4: npm 启动项目
ERR! webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
ERR! This is probably not a problem with npm. There is likely additional logging output above.
删除node_modules
和
>npm cache clear --force
>npm install
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- ovod.cn 版权所有 湘ICP备2023023988号-4
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务