我想安装Polymer 2,为此我需要安装Bower。
当我这样做时
npm install -g bower
我得到了
npm ERR! path C:\Users\xxx\AppData\Roaming\npm\node_modules\bower
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\xxx\AppData\Roaming\npm\node_modules\bower' -> 'C:\Users\xxx\AppData\Roaming\npm\node_modules\.bower.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxx\AppData\Roaming\npm-cache\_logs\2018-03-19T23_03_27_559Z-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 'install',
1 verbose cli '-g',
1 verbose cli 'bower' ]
2 info using npm@5.6.0
3 info using node@v8.10.0
4 verbose npm-session 678db3b2d10cf1b3
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/bower 375ms
8 silly pacote tag manifest for bower@latest fetched in 437ms
9 warn deprecated bower@1.8.2: ...psst! Your project can stop working at any moment because its dependencies can change. Prevent this by migrating to Yarn: https://bower.io/blog/2017/how-to-migrate-away-from-bower/
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly install loadAllDepsIntoIdealTree
14 silly resolveWithNewModule bower@1.8.2 checking installable status
15 silly currentTree npm
16 silly idealTree npm
16 silly idealTree `-- bower@1.8.2
17 silly install generateActionsToTake
18 silly diffTrees action count 1
19 silly diffTrees add bower@1.8.2
20 silly decomposeActions action count 8
21 silly decomposeActions fetch bower@1.8.2
22 silly decomposeActions extract bower@1.8.2
23 silly decomposeActions preinstall bower@1.8.2
24 silly decomposeActions build bower@1.8.2
25 silly decomposeActions install bower@1.8.2
26 silly decomposeActions postinstall bower@1.8.2
27 silly decomposeActions finalize bower@1.8.2
28 silly decomposeActions refresh-package-json bower@1.8.2
29 silly install executeActions
30 silly doSerial global-install 8
31 verbose correctMkdir C:\Users\xxx\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
32 verbose makeDirectory C:\Users\xxx\AppData\Roaming\npm-cache\_locks creation not in flight; initializing
33 verbose makeCacheDir UID & GID are irrelevant on win32
34 verbose lock using C:\Users\xxx\AppData\Roaming\npm-cache\_locks\staging-b87bd1c8617be94e.lock for C:\Users\xxx\AppData\Roaming\npm\node_modules\.staging
35 silly doParallel extract 8
36 silly extract bower@1.8.2
37 silly pacote trying bower@https://registry.npmjs.org/bower/-/bower-1.8.2.tgz by hash: sha1-rfU1KcjUrwLvJPuNU0HBQZ0z4vc=
38 silly pacote data for sha1-rfU1KcjUrwLvJPuNU0HBQZ0z4vc= not present. Using manifest.
39 http fetch GET 200 https://registry.npmjs.org/bower/-/bower-1.8.2.tgz 3375ms
40 silly pacote bower@https://registry.npmjs.org/bower/-/bower-1.8.2.tgz extracted in 3375ms
41 silly doReverseSerial unbuild 8
42 silly doSerial remove 8
43 silly doSerial move 8
44 silly doSerial finalize 8
45 silly finalize C:\Users\xxx\AppData\Roaming\npm\node_modules\bower
46 verbose unlock done using C:\Users\xxx\AppData\Roaming\npm-cache\_locks\staging-b87bd1c8617be94e.lock for C:\Users\xxx\AppData\Roaming\npm\node_modules\.staging
47 verbose stack Error: ENOENT: no such file or directory, rename 'C:\Users\xxx\AppData\Roaming\npm\node_modules\bower' -> 'C:\Users\xxx\AppData\Roaming\npm\node_modules\.bower.DELETE'
48 verbose cwd C:\BookaPolymer
49 verbose Windows_NT 10.0.16299
50 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
51 verbose node v8.10.0
52 verbose npm v5.6.0
53 error path C:\Users\xxx\AppData\Roaming\npm\node_modules\bower
54 error code ENOENT
55 error errno -4058
56 error syscall rename
57 error enoent ENOENT: no such file or directory, rename 'C:\Users\xxx\AppData\Roaming\npm\node_modules\bower' -> 'C:\Users\xxx\AppData\Roaming\npm\node_modules\.bower.DELETE'
58 error enoent This is related to npm not being able to find a file.
59 verbose exit [ -4058, true ]
为什么我会这样做?