Я обновил мое угловое приложение до версии 8.1 и, как обычно, я хотел бы запустить сервер разработки, запустив сценарий запуска npm в качестве задачи VS Code с CTRL+P
и набрав task start
.
Также при запуске npm run start
формы PowerShell он немедленно завершает работу и запрашивает открытие файла сценария ввода ng со следующим содержимым.
#!/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.
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]) < 10 || (Number(version[0]) === 10 && Number(version[1]) < 9)) {
process.stderr.write(
'You are running version ' + process.version + ' of Node.js, which is not supported by Angular CLI 8.0+.\n' +
'The official Node.js version that is supported is 10.9 or 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');
При запуске команды ng serve
из PowerShell всеработает отлично.npm также настроен на использование powershell:
script-shell = "C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
shell = "C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\powershell.exe"
Зачем открывать сценарий вместо его выполнения?