我在安装Angular时发现了以下问题。
$ node -v
v9.10.1
$ npm -v
5.8.0
$ ng --version
Unable to find "@angular/cli" in devDependencies.
Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest"
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 1.7.4
Node: 9.10.1
OS: darwin x64
Angular: undefined
...
typescript: error
webpack: error
正如您所看到的,Angular版本是“未定义”,cli和typescript,webpack是一个错误。这是我的问题。我试图创建一个项目。
$ ng new test-proj
You cannot use the new command inside an Angular CLI project.
我跟着Angular guide page,但我没有成功。
// package.json
{
"name": "test",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"repository": {
"type": "git",
"url": "git+ ... skip ... "
},
"author": "",
"license": "ISC",
"bugs": {
"url": " ... skip ... "
},
"homepage": " ... skip ... ",
"dependencies": {
"formidable": "^1.2.1"
},
"devDependencies": {
"@angular/cli": "^1.7.4"
},
"keywords": [],
"description": ""
}
请帮帮我。 怎么了?