我正在尝试遵循教程,我需要做的事情之一是 npm install -g generator-meanjs。运行该命令后,我收到以下错误:
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\zach\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "generator-meanjs"
npm ERR! node v4.2.3
npm ERR! npm v3.5.1
npm ERR! path C:\Users\zach\AppData\Roaming\npm\node_modules\generator-meanjs\node_modules\yeoman-generator\node_modules\download\node_modules\gulp-decompress\node_modules\decompress\node_modules\decompress-tarbz2\node_modules\seek-bzip\node_modules\commander
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\zach\AppData\Roaming\npm\node_modules\generator-meanjs\node_modules\yeoman-generator\node_modules\download\node_modules\gulp-decompress\node_modules\decompress\node_modules\decompress-tarbz2\node_modules\seek-bzip\node_modules\commander' -> 'C:\Users\zach\AppData\Roaming\npm\node_modules\generator-meanjs\node_modules\commander'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\zach\AppData\Roaming\npm\node_modules\generator-meanjs\node_modules\yeoman-generator\node_modules\download\node_modules\gulp-decompress\node_modules\decompress\node_modules\decompress-tarbz2\node_modules\seek-bzip\node_modules\commander' -> 'C:\Users\zach\AppData\Roaming\npm\node_modules\generator-meanjs\node_modules\commander'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! C:\WINDOWS\system32\npm-debug.log
npm ERR! code 1
它告诉我重命名
C:\Users\zach\AppData\Roaming\npm\node_modules\generator-meanjs\node_modules\yeoman-generator\node_modules\download\node_modules\gulp-decompress\node_modules\decompress\node_modules\decompress-tarbz2\node_modules\seek-bzip\node_modules\commander'->
但我不知道该将其重命名为什么。有人能帮我解释一下这个错误吗?
它还有一个调试日志,但是非常长。
答案1
我通过删除文件夹 generator-meanjs 并使用 Windows Powershell 以管理员身份重新安装它来解决这个问题。