1、Error: setuid user id does not exist

  1. Error: setuid user id does not exist
  2. at /usr/local/lib/node_modules/npm/node_modules/uid-number/uid-number.js:49:16
  3. at ChildProcess.exithandler (child_process.js:285:7)
  4. at ChildProcess.emit (events.js:182:13)
  5. at maybeClose (internal/child_process.js:962:16)
  6. at Socket.stream.socket.on (internal/child_process.js:381:11)
  7. at Socket.emit (events.js:182:13)
  8. at Pipe._handle.close (net.js:610:12)
  9. TypeError: Cannot read property 'loaded' of undefined
  10. at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
  11. at errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
  12. at /usr/local/lib/node_modules/npm/bin/npm-cli.js:77:20
  13. at cb (/usr/local/lib/node_modules/npm/lib/npm.js:225:22)
  14. at /usr/local/lib/node_modules/npm/lib/npm.js:263:24
  15. at /usr/local/lib/node_modules/npm/lib/config/core.js:83:7
  16. at Array.forEach (<anonymous>)
  17. at /usr/local/lib/node_modules/npm/lib/config/core.js:82:13
  18. at f (/usr/local/lib/node_modules/npm/node_modules/once/once.js:25:25)
  19. at afterExtras (/usr/local/lib/node_modules/npm/lib/config/core.js:173:20)
  20. /usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98
  21. var doExit = npm.config.loaded ? npm.config.get('_exit') : true
  22. ^
  23. TypeError: Cannot read property 'loaded' of undefined
  24. at exit (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:98:27)
  25. at process.errorHandler (/usr/local/lib/node_modules/npm/lib/utils/error-handler.js:216:3)
  26. at process.emit (events.js:182:13)
  27. 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、设置代理

  1. $ npm config set proxy=http://127.0.0.1:8087
  2. $ npm config delete proxy
  3. $ npm config set registry=http://registry.npmjs.org

4、奇怪报错

  1. Unexpected end of JSON input while parsing near '...75189a47b39759b783e",'

5、用户名

  1. # 查看
  2. $ git config user.name
  3. $ git config user.email
  4. # 设置
  5. $ git config --global user.name "username"
  6. $ 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. cesium定义线面

    面: var polygon = viewer.entities.add({ polygon : { hierarchy : { positions : null, holes : [{ positi ...

  2. Prometheus 【目录】

    正在陆续更新,内容大体包括: rule.标签重置.cAdversior.自动发现(File 自动发现.DNS自动发现.k8s环境自动发现)等... 目录: prometheus[第一篇] Promet ...

  3. 1、Docker 简介

    目录 Docker 起源 Docker 架构 特性 局限 名称空间隔离 原理 Control Groups (cgroups) Docker Docker 啥是docker? Docker 是一个开源 ...

  4. jQuery.hasClass() 函数详解

    jQuery.hasClass() 函数详解 hasClass()函数用于指示当前jQuery对象所匹配的元素是否含有指定的css类名. 该函数属于jQuery对象(实例). 语法 JavaScrip ...

  5. AWK工具 使用介绍

    第6周第5次课(4月27日) 课程内容: 9.6/9.7 awk扩展把这里面的所有练习题做一下http://www.apelearn.com/study_v2/chapter14.html 9.6/9 ...

  6. Kafka 0.10.0.1 consumer get earliest partition offset from Kafka broker cluster - scala code

    Return: Map[TopicPartition, Long] Code: val props = new Properties() props.put(ConsumerConfig.BOOTST ...

  7. 【SSL1457】翻币问题

    题面: \[\Large\text{翻币问题}\] \[Time~Limit:1000MS~~Memory~Limit:65536K\] Description 有N个硬币(6<=N<=2 ...

  8. 高德APP全链路源码依赖分析工程

    一.背景 高德 App 经过多年的发展,其代码量已达到数百万行级别,支撑了高德地图复杂的业务功能.但与此同时,随着团队的扩张和业务的复杂化,越来越碎片化的代码以及代码之间复杂的依赖关系带来诸多维护性问 ...

  9. 《手把手教你》系列练习篇之8-python+ selenium自动化测试 -压台篇(详细教程)

    1. 简介 本文是练习篇的最后一篇文章,虽然练习篇的文章到此就要和大家说拜拜了,但是我们的学习之路才刚刚开始.不要停下你的脚步,大步朝前走吧!比你优秀的人还在走着,我们有什么理由停下自己的脚步了,生命 ...

  10. Python爬虫实战之爬取糗事百科段子

    首先,糗事百科大家都听说过吧?糗友们发的搞笑的段子一抓一大把,这次我们尝试一下用爬虫把他们抓取下来. 友情提示 糗事百科在前一段时间进行了改版,导致之前的代码没法用了,会导致无法输出和CPU占用过高的 ...