安装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)

解决方法:重启终端就可以了。

    原文作者:宋鸿康iOS
    原文地址: https://www.jianshu.com/p/a7431e689a09
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞