npm install nativescript -g
を実行すると、npmでnativescript-cliをインストールできません。理由はわかりません。
node --version => 12.16.2
npm --version => 6.14.4
私は試した :
-キャッシュフォルダーの削除とnpm cache clean --force
-npm config set registry http://registry.npmjs.com
-マルウェア対策をオフにする
しかし、問題はまだ解決されていません。
これはnpmログファイルの出力です
11148 warn tar ENOENT: no such file or directory, open 'C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging\es5-ext-57d686a6\test\function\invoke.js'
11149 warn tar ENOENT: no such file or directory, open 'C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging\es5-ext-57d686a6\function\is-arguments.js'
11150 http fetch GET 200 https://registry.npmjs.org/@sinonjs/commons/-/commons-1.6.0.tgz 22ms (from cache)
11151 verbose unlock done using C:\Users\Mohammad Reza\AppData\Roaming\npm-cache\_locks\staging-60ffea16dce7f1cb.lock for C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging
11152 timing stage:rollbackFailedOptional Completed in 2ms
11153 timing stage:runTopLevelLifecycles Completed in 200098ms
11154 warn optional SKIPPING OPTIONAL DEPENDENCY: @types/[email protected] (node_modules\nativescript\node_modules\@types\node):
11155 warn optional SKIPPING OPTIONAL DEPENDENCY: Response timeout while trying to fetch https://registry.npmjs.com/@types%2fnode (over 30000ms)
11156 warn optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\nativescript\node_modules\TypeScript):
11157 warn optional SKIPPING OPTIONAL DEPENDENCY: Response timeout while trying to fetch https://registry.npmjs.com/TypeScript (over 30000ms)
11158 verbose type body-timeout
11159 verbose stack FetchError: Response timeout while trying to fetch https://registry.npmjs.com/pacote (over 30000ms)
11159 verbose stack at Timeout._onTimeout (C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\body.js:189:16)
11159 verbose stack at listOnTimeout (internal/timers.js:549:17)
11159 verbose stack at processTimers (internal/timers.js:492:7)
11160 verbose cwd C:\Windows\system32
11161 verbose Windows_NT 10.0.18363
11162 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mohammad Reza\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "nativescript" "-g"
11163 verbose node v12.16.2
11164 verbose npm v6.14.4
11165 error Response timeout while trying to fetch https://registry.npmjs.com/pacote (over 30000ms)
11166 verbose exit [ 1, true ]
私はこの問題に直面し、Stackoverflowですべての答えを試しましたが、うまくいきませんでした。ようやくこの問題の解決策が見つかりました。
それは私のために働いた、幸運:)