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 问题汇总的更多相关文章

  1. 开发常用镜像资源替换为国内开源镜像(yum,compose,maven,docker,android sdk,npm,国内开源镜像汇总)

    一.国内开源镜像站点汇总 阿里云开源镜像站 (http://mirrors.aliyun.com/)网易开源镜像站 (http://mirrors.163.com/)中国科学技术大学开源镜像站 (ht ...

  2. npm常用模块汇总

    npm常用模块汇总: 点击插件名字,查看使用文档 npm常用模块汇总 node常用模块汇总 gulp常用插件汇总 npx 使用教程:npx使用教程 bable:bable这是JavaScript编译器 ...

  3. npm常用命令汇总

    npm是一个node包管理和分发工具,已经成为了非官方的发布node模块(包)的标准. 有了npm,可以很快的找到特定服务要使用的包,进行下载.安装以及管理已经安装的包. 1.npm install ...

  4. npm汇总:npm命令 + 实用插件

    一.npm常用命令,以便查阅: npm install     //运行npm install可根据package.json的配置自动安装所有依赖包 npm uninstall   //卸载依赖,如n ...

  5. npm install 安装项目依赖,报错ERR! Unexpected end of JSON input while parsing near的方法汇总

    问题描述: npm install 安装项目依赖的时候,有时会出现: ERR! Unexpected end of JSON input while parsing near 错误 原因: npm 的 ...

  6. npm 安装扩展模块时,因缓存报错的问题汇总

    1.缓存报错问题一 :    unexpected end of file 解决方法:运行:npm cache verify  清除缓存 2.缓存报错问题二 :   errno -4048(网上一般说 ...

  7. npm常用命令及其node相关工具汇总

    它是一个事件驱动异步I/O单进程的服务端JS环境,基于Google的V8引擎,V8引擎执行Javascript的速度非常快,性能非常好. 浏览器是JS的前端运行环境. Node.js是JS的后端运行环 ...

  8. NPM 错误、问题等汇总

    一. npm的作用就是对Node.js依赖的包进行管理,也可以理解为用来安装/卸载Node.js需要装的东西 二. 1. 修改npm配置为淘宝的源下载: npm install -g cnpm --r ...

  9. 解决npm ERR! Unexpected end of JSON input while parsing near的方法汇总

    参考链接:https://segmentfault.com/a/1190000015646531

随机推荐

  1. 3、Docker 基础安装和基础使用 二

    Docker 网络 启动了nginx容器,但却不知道从哪里进行访问nginx. 启动nginx容器,并附加网络映射 在启动nginx容器的时候,增加一个-P大写的P的参数 表示随机映射一个端口 [ro ...

  2. diff()函数的使用

    1.diff():返回略微迭代(lagged)的或滞后的不同(iterated diferences). > x<-cumsum(cumsum(1:10)) > x [1] 1 4 ...

  3. spring boot 一个项目启动多个实例

    0.前言 在开发中,我们经常需要以不同端口启动同一个项目的多个实例,IDEA中启动多个实例很简单 1.方法 1.1.在项目中,选择编辑配置,然后点选允许并行运行,如下图: 1.2.调出RunDashb ...

  4. WPF最简单的分页控件

    背景:最近在写项目的时候需要写一个简单的分页功能,因项目需要,没有改为MVVM模式,只需要在后台实现 1.呈现效果如下: 接下来就来上代码,看看怎么实现的 1.界面代码 <StackPanel ...

  5. 洛谷 题解 2165 [AHOI2009]飞行棋

    本蒟蒻又来发题解了, 看到这个题目,本蒟蒻直接开始推公式.. 嗯,可以通过弧长,推出弦长(l = 2 * r * cos(90 * l / (r * Π)); 然后对比各条弦长的平方和与直径的平方. ...

  6. C语言I作业12-学期总结

    一.我学到的内容 二.我的收获 我完成的作业: 第一次作业 C语言I博客作业02 C语言I作业004 C语言I博客作业05 C语言I博客作业06 C语言I博客作业07 C语言I博客作业08 C语言I博 ...

  7. mac 安装 XX-Net-3.12.11

    目录 一 下载xx-net稳定版 二 使用Chrome浏览器 三 开启IPv6 mac禁用SIP机制 SIP 步骤 其他 附完整的csrutil命令 一 下载xx-net稳定版 github稳定版-X ...

  8. 设计模式GOF23(创建型模式)

    • 创建型模式:  单例模式.工厂模式.抽象工厂模式.建造者模式.原型模式.   • 结构型模式: –适配器模式.桥接模式.装饰模式.组合模式.外观模式.享元模式.代理模式.   • 行为型模式: 模 ...

  9. JavaScript基础5

    字符串操作方法和属性 length   获取字符串的长度 str.chartAt(指定字符的索引)  获取指定位置的字符 返回string类型的值 str.concat(字符串)   链接多个字符串  ...

  10. Git下载安装及github基本操作

    Windows下Git下载 官网提供的Git下载地址: 官网下载地址,一般直接从官网下载会出现无反应等情况,这里提供windows32和64位版本的百度网盘资源:windows下的Git下载地址.有需 ...