NPM 问题汇总
1、Error: setuid user id does not exist
Error: setuid user id does not exist
at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:49:16
at ChildProcess.exithandler (child_process.js:285:7)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Socket.stream.socket.on (internal/child_process.js:381:11)
at Socket.emit (events.js:182:13)
at Pipe._handle.close (net.js:610:12)
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:77:20
at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
at /usr/local/lib/node_modules/npm/lib/config/core.js:83:7
at Array.forEach (<anonymous>)
at /usr/local/lib/node_modules/npm/lib/config/core.js:82:13
at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:173:20)
/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined
at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
at process.emit (events.js:182:13)
at process._fatalException (internal/bootstrap/node.js:494:27)
在编辑器中打开以下文件:
/usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js
到 11 行,将 uidSupport = process.getuid && process.setuid 修改为 uidSupport = false
2、npm link

通过 npm link 可以很容易的调试开发库,有几个需要注意的地方:
- 目录地址,看一下要链接的地址是不是正确
- Mac 上需要使用
sudo
3、设置代理
$ npm config set proxy=http://127.0.0.1:8087
$ npm config delete proxy
$ npm config set registry=http://registry.npmjs.org
4、奇怪报错
Unexpected end of JSON input while parsing near '...75189a47b39759b783e",'
5、用户名
# 查看
$ git config user.name
$ git config user.email
# 设置
$ git config --global user.name "username"
$ git config --global user.email "email"
NPM 问题汇总的更多相关文章
- 开发常用镜像资源替换为国内开源镜像(yum,compose,maven,docker,android sdk,npm,国内开源镜像汇总)
一.国内开源镜像站点汇总 阿里云开源镜像站 (http://mirrors.aliyun.com/)网易开源镜像站 (http://mirrors.163.com/)中国科学技术大学开源镜像站 (ht ...
- npm常用模块汇总
npm常用模块汇总: 点击插件名字,查看使用文档 npm常用模块汇总 node常用模块汇总 gulp常用插件汇总 npx 使用教程:npx使用教程 bable:bable这是JavaScript编译器 ...
- npm常用命令汇总
npm是一个node包管理和分发工具,已经成为了非官方的发布node模块(包)的标准. 有了npm,可以很快的找到特定服务要使用的包,进行下载.安装以及管理已经安装的包. 1.npm install ...
- npm汇总:npm命令 + 实用插件
一.npm常用命令,以便查阅: npm install //运行npm install可根据package.json的配置自动安装所有依赖包 npm uninstall //卸载依赖,如n ...
- npm install 安装项目依赖,报错ERR! Unexpected end of JSON input while parsing near的方法汇总
问题描述: npm install 安装项目依赖的时候,有时会出现: ERR! Unexpected end of JSON input while parsing near 错误 原因: npm 的 ...
- npm 安装扩展模块时,因缓存报错的问题汇总
1.缓存报错问题一 : unexpected end of file 解决方法:运行:npm cache verify 清除缓存 2.缓存报错问题二 : errno -4048(网上一般说 ...
- npm常用命令及其node相关工具汇总
它是一个事件驱动异步I/O单进程的服务端JS环境,基于Google的V8引擎,V8引擎执行Javascript的速度非常快,性能非常好. 浏览器是JS的前端运行环境. Node.js是JS的后端运行环 ...
- NPM 错误、问题等汇总
一. npm的作用就是对Node.js依赖的包进行管理,也可以理解为用来安装/卸载Node.js需要装的东西 二. 1. 修改npm配置为淘宝的源下载: npm install -g cnpm --r ...
- 解决npm ERR! Unexpected end of JSON input while parsing near的方法汇总
参考链接:https://segmentfault.com/a/1190000015646531
随机推荐
- Windows系统中下载Earthdata数据
总的来说,为四大步: 1.注册Earthdata用户. 注册时需注意的是,最好把所有需打勾的都勾上,在最后[注册]按钮前,弹出[人机验证]才能注册成功.如果注册不成功,除了检查用户名和密码是否符合要求 ...
- 如何在导航条的button点击变换时,切换对应的控制器
1.导航条内的button被点击 切换对应的控制器 让控制器作为调航条的代理 1.定义代理 2.遵循代理协议 3.实现代理 4.在合适的地方调用代理 当按钮被点击的时候切换控制器
- 配置aria2
Mac 用户肯定都受够了百度网盘在自己电脑上的糟糕体验,至少我是如此:安装官方的 App,经常下载时中断,有时甚至 Bug 般连续中断,无奈使用浏览器下载,速度却是令人挠头.花点时间来配置 aria2 ...
- Docker 02 - 向 Docker 的 Tomcat 镜像中部署 Web 应用
目录 1 下载 Docker 镜像 2 部署Web项目 2.1 通过Dockerfile自定义项目镜像 2.2 启动自定义镜像, 生成一个容器 2.3 另一种启动方式: 交互式启动 3 (附) 向镜像 ...
- python学习笔记—DataFrame和Series的排序
更多大数据分析.建模等内容请关注公众号<bigdatamodeling> ################################### 排序 ################## ...
- 使用iCamera 测试AR0331 300w高分辨率摄像头小结
使用iCamera 测试AR0331 300w高分辨率摄像头小结 先看下sensor特性 分辨率最高可达:2048*1536=300w像素 1080p帧率最高可达60fps 本次使用usb2,帧率14 ...
- 直击面试,聊聊 GC 机制
前言 文章来源:https://studyidea.cn/ GC 中文直译垃圾回收,是一种回收内存空间避免内存泄漏的机制.当 JVM 内存紧张,通过执行 GC 有效回收内存,转而分配给新对象从而实现内 ...
- Day 02 计算机的基本组成及工作原理
目录 计算机的构成 CPU 控制器 运算器 存储器 内存 外存 I/O (input & output) 输入设备 输出设备 什么是编程语言 什么是编程 为什么要编程 多核CPU 32位和64 ...
- Centos 8 安装 Nginx
安装步骤: /* 1. 安装编译工具及库文件 */ yum -y install gcc automake autoconf libtool make && yum install g ...
- redis(5)--redis集群之哨兵机制
哨兵机制 在前面讲的master/slave模式,在一个典型的一主多从的系统中,slave在整个体系中起到了数据冗余备份和读写分离的作用.当master遇到异常终端后,需要从slave中选举一个新的m ...