C:\Users\Administrator>npm install --global --production windows-build-tools
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
windows-build-tools@5.2.2 postinstall C:\Users\Administrator\AppData\Roaming\npm\node_modules\windows-build-tools
node ./dist/index.js
Downloading python-2.7.15.amd64.msi
Downloaded python-2.7.15.amd64.msi. Saved to C:\Users\Administrator\.windows-build-tools\python-2.7.15.amd64.msi.
Downloading vs_BuildTools.exe
Downloaded vs_BuildTools.exe. Saved to C:\Users\Administrator\.windows-build-tools\vs_BuildTools.exe.
Starting installation...
Please restart this script from an administrative PowerShell!
The build tools cannot be installed without administrative rights.
To fix, right-click on PowerShell and run "as Administrator".
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! windows-build-tools@5.2.2 postinstall: `node ./dist/index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the windows-build-tools@5.2.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-07-16T01_21_00_593Z-debug.log
本文过长,总结放在前面
关键词:
info: 信息节点、verbose: 详细的、silly: 直接的、Http: 请求
以下关联词的含义慢慢了解
info using、lifecycle、linkStuff
verbose cli、npm-session、correctMkdir、makeCacheDir、linkBins、lifecycle、unlock、stack、arg、cwd、pkgid、node、npm、exit、lock using
silly install、checking status、pacote range manifest、currentTree、idealTree、diff-trees、decomposeActions、tarball trying 、extract、tarball、doReverseSerial、doSerial、finalize、refresh-package-json、build、linkStuff
timing stage Completed、action:extract Completed、action:finalize Completed、action:refresh-package-json、action:preinstall Completed
http fetch
补充:
日志内容
## 提纲
0 info it worked if it ends with ok 如果它以ok结尾,它就成功了
## 分析用户指令,拆解
1 verbose cli 详细的
CLi:command-line interface 命令行界面 是指可在用户提示符下键入可执行指令的界面
用户通过键盘输入指令,计算机接收到指令后,予以执行 CLI在汇编指令中也有关闭中断的意思
CLI: 是框架提供的运行环境,开发人员不必关注运行环境,只需关注代码逻辑,
即只需好好搬砖就能将一个项目做成做好
[
1 verbose cli 'D:\\Program Files\\develop\\node\\node.exe',
1 verbose cli 'D:\\Program Files\\develop\\node\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--global',
1 verbose cli '--production',
1 verbose cli 'windows-build-tools'
1 verbose cli
]
## 使用npm版本
2 info using npm@6.10.2
## 使用的相关的node版本
3 info using node@v12.8.0
## npm-session:百度无果
4 verbose npm-session fa8c5852c4d1a25a
## silly install loadCurrentTree 安装了什么,百度无果
5 silly install loadCurrentTree
## silly install readGlobalPackageData 安装了什么,百度无果,应该是直接读取包的内容
6 silly install readGlobalPackageData
## 从 网址中获取 状态是 304 深入理解:可以参考 https://blog.csdn.net/Dongguabai/article/details/84323511
7 http fetch GET 304 https://registry.npmjs.org/windows-build-tools 986ms (from cache)
## 1.011s的时间为windows-tools获取标签清单
8 silly pacote tag manifest for windows-build-tools@latest fetched in 1011ms
## 1.036秒 完成loadCurrentTree安装
9 timing stage:loadCurrentTree Completed in 1036ms
## 傻瓜式安装 loadIdealTree
10 silly install loadIdealTree
## 傻瓜式安装 cloneCurrentTreeToIdealTree
11 silly install cloneCurrentTreeToIdealTree
## 0秒完成cloneCurrentTreeToIdealTree 安装
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
## 傻瓜式安装 loadShrinkwrap
13 silly install loadShrinkwrap
## 0.002秒完成 loadIdealTree loadShrinkwrap 的安装
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
## 傻瓜式安装 loadAllDepsIntoIdealTree
15 silly install loadAllDepsIntoIdealTree
## 检查 window-build-tools5.2.2 安装的状态
16 silly resolveWithNewModule windows-build-tools@5.2.2 checking installable status
## 0.611秒 抓取 https://registry.npmjs.org/fs-extra
17 http fetch GET 200 https://registry.npmjs.org/fs-extra 611ms
## 0.617秒 抓取 https://registry.npmjs.org/fs-extra
18 silly pacote range manifest for fs-extra@^8.0.1 fetched in 617ms
## 检查 window-build-tools8.1.0 安装的状态
19 silly resolveWithNewModule fs-extra@8.1.0 checking installable status
## 从 网址中获取 状态是 304 深入理解:可以参考 https://blog.csdn.net/Dongguabai/article/details/84323511 缓存中已经有的,再次获取 会出现304
20 http fetch GET 304 https://registry.npmjs.org/in-gfw 831ms (from cache)
21 http fetch GET 304 https://registry.npmjs.org/chalk 836ms (from cache)
22 http fetch GET 304 https://registry.npmjs.org/string-width 830ms (from cache)
23 http fetch GET 304 https://registry.npmjs.org/nugget 834ms (from cache)
24 http fetch GET 304 https://registry.npmjs.org/debug 840ms (from cache)
## 0.838秒抓取in-gfw
25 silly pacote range manifest for in-gfw@^1.2.0 fetched in 838ms
## 检查安装状态
26 silly resolveWithNewModule in-gfw@1.2.0 checking installable status
27 silly pacote range manifest for chalk@^2.4.2 fetched in 845ms
28 silly resolveWithNewModule chalk@2.4.2 checking installable status
29 silly pacote range manifest for string-width@^4.1.0 fetched in 837ms
30 silly resolveWithNewModule string-width@4.2.0 checking installable status
31 silly pacote range manifest for nugget@^2.0.1 fetched in 840ms
32 silly resolveWithNewModule nugget@2.0.1 checking installable status
33 silly pacote range manifest for debug@^4.1.1 fetched in 845ms
34 silly resolveWithNewModule debug@4.1.1 checking installable status