npm安装报错问题

今天手贱rm -rf 了npm,然后重装之后出现了这个问题

path.js:1142
          cwd = process.cwd();
                        ^

Error: ENOENT: no such file or directory, uv_cwd
    at Error (native)
    at Object.resolve (path.js:1142:25)
    at Function.Module._resolveLookupPaths (module.js:390:17)
    at Function.Module._resolveFilename (module.js:460:31)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at /usr/local/lib/node_modules/npm/bin/npm-cli.js:25:13
    at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:75:3)
    at Module._compile (module.js:570:32)

然后删除node重装也不行,有没有人遇到过相同的问题啊

阅读 22.4k
2 个回答

我也碰到这个问题,查到这里的,重启终端之后就ok了

I got this when trying to run the Node REPL from a directory I had already deleted (from another shell). Don't let this happen to you or you will be ashamed.

原帖地址
http://stackoverflow.com/ques...

请重启shell

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题