zoukankan      html  css  js  c++  java
  • 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

    通过 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"
    
  • 相关阅读:
    让div 充满整个body GIS
    fortuneclient 学习 (客户端接受数据) GIS
    错误 1 error C1083: 无法打开包括文件:“QNetworkProxy”: No such file or directory GIS
    qt fortuneserver 例子学习 ( 给客户端发送消息) GIS
    new操作符(new operator) 和 new操作(operator new)的区别。 GIS
    qt 控件 GIS
    c++ 顺序容器 GIS
    将一个div 分成两列 也可以分成多列 GIS
    控件模板 1
    WPF简单写写。。。
  • 原文地址:https://www.cnblogs.com/nzbin/p/11109228.html
Copyright © 2011-2022 走看看