标签:stdout ber ping symlink google red swa dup options
我们新建一个项目。执行 ng server 会启动一个网站。
1. 执行 where ng 。看看ng 是什么.
D:\Abp学习\angular\Mytest>where ng C:\Users\QiGongbo\AppData\Roaming\npm\ng C:\Users\QiGongbo\AppData\Roaming\npm\ng.cmd
实际执行到了ng.cmd:
@IF EXIST "%~dp0\node.exe" ( # C:\Users\QiGongbo\AppData\Roaming\npm\\node_modules\@angular\cli\bin\ng "%~dp0\node.exe" "%~dp0\node_modules\@angular\cli\bin\ng" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node "%~dp0\node_modules\@angular\cli\bin\ng" %* )
这个 ng 是个JS文件。 文件是这样的:
#!/usr/bin/env node ‘use strict‘; // Provide a title to the process in `ps`. // Due to an obscure Mac bug, do not start this title with any symbol. console.log(process); try { process.title = ‘ng ‘ + Array.from(process.argv).slice(2).join(‘ ‘); } catch(_) { // If an error happened above, use the most basic title. process.title = ‘ng‘; } // Some older versions of Node do not support let or const. var version = process.version.substr(1).split(‘.‘); if (Number(version[0]) < 8 || (Number(version[0]) === 8 && Number(version[1]) < 9)) { process.stderr.write( ‘You are running version ‘ + process.version + ‘ of Node.js, which is not supported by Angular CLI v6.\n‘ + ‘The official Node.js version that is supported is 8.9 and greater.\n\n‘ + ‘Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.\n‘ ); process.exit(3); } require(‘../lib/init‘);
最后引用了 require(‘../lib/init‘);
init.js 如下:
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ require("symbol-observable"); // symbol polyfill must go first // tslint:disable-next-line:ordered-imports import-groups const core_1 = require("@angular-devkit/core"); const node_1 = require("@angular-devkit/core/node"); const fs = require("fs"); const path = require("path"); const semver_1 = require("semver"); const stream_1 = require("stream"); const config_1 = require("../utilities/config"); const packageJson = require(‘../package.json‘); function _fromPackageJson(cwd) { cwd = cwd || process.cwd(); do { const packageJsonPath = path.join(cwd, ‘node_modules/@angular/cli/package.json‘); if (fs.existsSync(packageJsonPath)) { const content = fs.readFileSync(packageJsonPath, ‘utf-8‘); if (content) { const json = JSON.parse(content); if (json[‘version‘]) { return new semver_1.SemVer(json[‘version‘]); } } } // Check the parent. cwd = path.dirname(cwd); } while (cwd != path.dirname(cwd)); return null; } // Check if we need to profile this CLI run. if (process.env[‘NG_CLI_PROFILING‘]) { let profiler; try { profiler = require(‘v8-profiler-node8‘); // tslint:disable-line:no-implicit-dependencies } catch (err) { throw new Error(`Could not require ‘v8-profiler-node8‘. You must install it separetely with` + `‘npm install v8-profiler-node8 --no-save.\n\nOriginal error:\n\n${err}`); } profiler.startProfiling(); const exitHandler = (options) => { if (options.cleanup) { const cpuProfile = profiler.stopProfiling(); fs.writeFileSync(path.resolve(process.cwd(), process.env.NG_CLI_PROFILING || ‘‘) + ‘.cpuprofile‘, JSON.stringify(cpuProfile)); } if (options.exit) { process.exit(); } }; process.on(‘exit‘, () => exitHandler({ cleanup: true })); process.on(‘SIGINT‘, () => exitHandler({ exit: true })); process.on(‘uncaughtException‘, () => exitHandler({ exit: true })); } let cli; try { const projectLocalCli = node_1.resolve(‘@angular/cli‘, { checkGlobal: false, basedir: process.cwd(), preserveSymlinks: true, }); // This was run from a global, check local version. const globalVersion = new semver_1.SemVer(packageJson[‘version‘]); let localVersion; let shouldWarn = false; try { localVersion = _fromPackageJson(); shouldWarn = localVersion != null && globalVersion.compare(localVersion) > 0; } catch (e) { // eslint-disable-next-line no-console console.error(e); shouldWarn = true; } if (shouldWarn && config_1.isWarningEnabled(‘versionMismatch‘)) { const warning = core_1.terminal.yellow(core_1.tags.stripIndents ` Your global Angular CLI version (${globalVersion}) is greater than your local version (${localVersion}). The local Angular CLI version is used. To disable this warning use "ng config -g cli.warnings.versionMismatch false". `); // Don‘t show warning colorised on `ng completion` if (process.argv[2] !== ‘completion‘) { // eslint-disable-next-line no-console console.error(warning); } else { // eslint-disable-next-line no-console console.error(warning); process.exit(1); } } // No error implies a projectLocalCli, which will load whatever // version of ng-cli you have installed in a local package.json cli = require(projectLocalCli); } catch (_a) { // If there is an error, resolve could not find the ng-cli // library from a package.json. Instead, include it from a relative // path to this script file (which is likely a globally installed // npm package). Most common cause for hitting this is `ng new` cli = require(‘./cli‘); } if (‘default‘ in cli) { cli = cli[‘default‘]; } // This is required to support 1.x local versions with a 6+ global let standardInput; try { standardInput = process.stdin; } catch (e) { delete process.stdin; process.stdin = new stream_1.Duplex(); standardInput = process.stdin; } cli({ cliArgs: process.argv.slice(2), inputStream: standardInput, outputStream: process.stdout, }) .then((exitCode) => { process.exit(exitCode); }) .catch((err) => { console.error(‘Unknown error: ‘ + err.toString()); process.exit(127); }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5pdC5qcyIsInNvdXJjZVJvb3QiOiIuLyIsInNvdXJjZXMiOlsicGFja2FnZXMvYW5ndWxhci9jbGkvbGliL2luaXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7O0dBTUc7QUFDSCw2QkFBMkI7QUFDM0IsZ0NBQWdDO0FBQ2hDLHlEQUF5RDtBQUN6RCwrQ0FBc0Q7QUFDdEQsb0RBQW9EO0FBQ3BELHlCQUF5QjtBQUN6Qiw2QkFBNkI7QUFDN0IsbUNBQWdDO0FBQ2hDLG1DQUFnQztBQUNoQyxnREFBdUQ7QUFFdkQsTUFBTSxXQUFXLEdBQUcsT0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUM7QUFFL0MsU0FBUyxnQkFBZ0IsQ0FBQyxHQUFZO0lBQ3BDLEdBQUcsR0FBRyxHQUFHLElBQUksT0FBTyxDQUFDLEdBQUcsRUFBRSxDQUFDO0lBRTNCLEdBQUc7UUFDRCxNQUFNLGVBQWUsR0FBRyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSx3Q0FBd0MsQ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2Nlc3MuZXhpdCgxMjcpO1xuICB9KTtcbiJdfQ==
标签:stdout ber ping symlink google red swa dup options
原文地址:https://www.cnblogs.com/qgbo/p/11635697.html