当我尝试使用以下命令在yeoman中安装generator-angular时,我得到了几个错误,我不知道如何解决它们。
npm install -g generator-angular
npm WARN peerDependencies The peer dependency generator-karma@>=0.9.0 included from generator-angular will no npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select' npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what' npm WARN peerDependencies The peer dependency yo@>=1.0.0 included from generator-karma will no npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\readable-stream\2.0.2\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\readable-stream\2.0.2\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\lodash\3.10.0\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\readable-stream\2.0.2\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\readable-stream\2.0.2\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\readable-stream\2.0.2\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\readable-stream\1.0.33\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\is-utf8\0.2.0\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\first-chunk-stream\1.0.0\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\is-utf8\0.2.0\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\first-chunk-stream\1.0.0\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\rx\2.5.3\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\readable-stream\1.1.13\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\replace-ext\0.0.1\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\clone\1.0.2\package.tgz npm ERR! tar.unpack untar error C:\Users\Ranjeet\AppData\Roaming\npm-cache\clone-stats\0.0.1\package.tgz npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "generator-angular" npm ERR! node v0.12.7 npm ERR! npm v2.11.3 npm ERR! path C:\Users\Ranjeet\AppData\Roaming\npm\node_modules\generator-karma\node_modules\yeoman-generator\node_modules\lodash\lang\isObject.js npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! enoent ENOENT, open 'C:\Users\Ranjeet\AppData\Roaming\npm\node_modules\generator-karma\node_modules\yeoman-generator\node_modules\lodash\lang\isObject.js' 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
答案 0 :(得分:2)
不要担心peerDependencies
上的警告(这是自动生成器编码的方式,它将在npm的下一个版本中更改)
关于您的错误,我发现它们都是从缓存中解压缩文件(这些文件在下载时可能已损坏)。尝试npm cache clean
然后重新安装。