windowsのコマンドプロンプトで npm install
を実行したところ
npm ERR! Unexpected token '.'
で処理が止まってしまいます。
logが出力されていますが、エラーに関連しそうな情報は得られていません。
0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using [email protected]
2 info using [email protected]
3 timing npm:load:whichnode Completed in 0ms
4 timing config:load:defaults Completed in 2ms
5 timing config:load:file:C:\Users\owner\AppData\Roaming\nvm\v16.19.0\node_modules\npm\npmrc Completed in 1ms
6 timing config:load:builtin Completed in 1ms
7 timing config:load:cli Completed in 1ms
8 timing config:load:env Completed in 1ms
9 timing config:load:file:c:\web\010_electron\.npmrc Completed in 0ms
10 timing config:load:project Completed in 1ms
11 timing config:load:file:C:\Users\owner\.npmrc Completed in 0ms
12 timing config:load:user Completed in 0ms
13 timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 0ms
14 timing config:load:global Completed in 1ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:credentials Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 9ms
19 timing npm:load:configload Completed in 9ms
20 timing npm:load:mkdirpcache Completed in 0ms
21 timing npm:load:mkdirplogs Completed in 0ms
22 verbose title npm update
23 verbose argv "update"
24 timing npm:load:setTitle Completed in 1ms
25 timing config:load:flatten Completed in 3ms
26 timing npm:load:display Completed in 4ms
27 verbose logfile logs-max:10 dir:C:\Users\owner\AppData\Local\npm-cache\_logs
28 verbose logfile C:\Users\owner\AppData\Local\npm-cache\_logs\2022-12-20T23_39_53_311Z-debug-0.log
29 timing npm:load:logFile Completed in 6ms
30 timing npm:load:timers Completed in 0ms
31 timing npm:load:configScope Completed in 0ms
32 timing npm:load Completed in 21ms
33 verbose stack C:\Users\owner\AppData\Roaming\nvm\v16.19.0\node_modules\npm\node_modules\@npmcli\arborist:1
33 verbose stack ../../workspaces/arborist
33 verbose stack ^
33 verbose stack
33 verbose stack SyntaxError: Unexpected token '.'
33 verbose stack at Object.compileFunction (node:vm:360:18)
33 verbose stack at wrapSafe (node:internal/modules/cjs/loader:1094:15)
33 verbose stack at Module._compile (node:internal/modules/cjs/loader:1129:27)
33 verbose stack at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
33 verbose stack at Module.load (node:internal/modules/cjs/loader:1043:32)
33 verbose stack at Function.Module._load (node:internal/modules/cjs/loader:878:12)
33 verbose stack at Module.require (node:internal/modules/cjs/loader:1067:19)
33 verbose stack at require (node:internal/modules/cjs/helpers:103:18)
33 verbose stack at Object.<anonymous> (C:\Users\owner\AppData\Roaming\nvm\v16.19.0\node_modules\npm\lib\commands\update.js:3:18)
33 verbose stack at Module._compile (node:internal/modules/cjs/loader:1165:14)
34 verbose cwd c:\web\010_electron
35 verbose Windows_NT 10.0.22000
36 verbose node v16.19.0
37 verbose npm v8.19.3
38 error Unexpected token '.'
39 verbose exit 1
40 timing npm Completed in 31ms
41 verbose code 1
42 error A complete log of this run can be found in:
42 error C:\Users\owner\AppData\Local\npm-cache\_logs\2022-12-20T23_39_53_311Z-debug-0.log
現在使用している環境は次のとおりです。
npm 8.19.3
nvm 1.1.10
node.js 16.19.0
nvm-windows のバージョンが 1.1.7 の時に発生するという投稿がありましたが、
現在は 1.1.10 を使っています。
後は何が原因と考えられるでしょうか?