环境:win10+npm3.10.5
问题:在npm install lodash时,出现下列错误("npm-debug.log"文件内容)
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',1 verbose cli 'start' ]2 info using npm@3.10.53 info using node@v4.4.74 verbose stack Error: ENOENT: no such file or directory, open 'C:\Program Files\nodejs\package.json'4 verbose stack at Error (native)5 verbose cwd C:\Program Files\nodejs6 error Windows_NT 10.0.105867 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"8 error node v4.4.79 error npm v3.10.510 error path C:\Program Files\nodejs\package.json11 error code ENOENT12 error errno -405813 error syscall open14 error enoent ENOENT: no such file or directory, open 'C:\Program Files\nodejs\package.json'15 error enoent ENOENT: no such file or directory, open 'C:\Program Files\nodejs\package.json'15 error enoent This is most likely not a problem with npm itself15 error enoent and is related to npm not being able to find a file.16 verbose exit [ -4058, true ]解决:以管理员身份运行就可以工作了