The "@angular/compiler-cli" package was not properly installed.
[X ] bug report -> please search issues before submitting
**Versions.**
@angular/cli: 1.0.0
node: 7.1.0
os: win32 x64
@angular/common: 2.1.2
@angular/compiler: 2.1.2
@angular/core: 2.1.2
@angular/forms: 2.1.2
@angular/http: 2.1.2
@angular/platform-browser: 2.1.2
@angular/platform-browser-dynamic: 2.1.2
@angular/router: 3.1.2
@angular/cli: 1.0.0
**Repro steps.**
run ng serve
**The log given by the failure.**
$ ng serve --verbose
The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
at Object.<anonymous> (C:\Users\rball\Documents\Dev\Angular\change-detection\node_modules\@ngtools\webpack\src\index.js:16:11)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\rball\Documents\Dev\Angular\change-detection\node_modules\@angular\cli\tasks\eject.js:10:19)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
**### Desired functionality.**
Launch ng serve without error
**### Mention any other details that might be useful.**
Have updated project and environment per "https://github.com/angular/angular-cli#updating-angular-cli"
See also http://stackoverflow.com/questions/42925690/angular2-cli-error-angular-compiler-cli-package-was-not-properly-installed/43021209#43021209
Package.json
{
"name": "change-detection",
"version": "0.0.0",
"license": "MIT",
"@angular/cli": {"version": "1.0.0"},
"scripts": {
"start": "ng serve",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor"
},
"private": true,
"dependencies": {
"@angular/common": "~2.1.0",
"@angular/compiler": "~2.1.0",
"@angular/core": "~2.1.0",
"@angular/forms": "~2.1.0",
"@angular/http": "~2.1.0",
"@angular/platform-browser": "~2.1.0",
"@angular/platform-browser-dynamic": "~2.1.0",
"@angular/router": "~3.1.0",
"core-js": "^2.4.1",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},
"devDependencies": {
"@angular/cli": "^1.0.0",
"@types/jasmine": "^2.2.30",
"@types/node": "^6.0.42",
"codelyzer": "1.0.0-beta.1",
"jasmine-core": "2.4.1",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"protractor": "4.0.9",
"ts-node": "1.2.1",
"tslint": "3.13.0",
"typescript": "~2.0.3",
"webdriver-manager": "10.2.5"
}
}
Make sure you cd into the file containing the package.json
I got the same error.... i gave command
npm install
and run the server ng serve
NodeJS installed as root (sudo apt get install nodejs) caused this problem for me. Using nvm tool fixed the problem https://github.com/creationix/nvm.
lready had an existing application I wanted to start using angular-cli in. When trying to implement angular-cli for an existing application, for me, just doing npm install -g @angular/cli and then trying to use the ng commands did not work.
After installing angular-cli I did the following.
In a command line, in windows, I went to my C:\ folder and ran the command
ng new foo. After nicely scaffolding my app, I copied the necessary files from this new folder and started moving them to my existing app folder and started sorting out the issues until I got my app running fine using angular-cli. This is the solution that worked for me when trying to implement angular-cli for an already existing application. Hope it helps
running npm install --save-dev @angular/cli@latest in the project folder fixed my problem
@intellix
Thanks a million. After moving the compiler-cli to my dependencies and re-installing it with npm install --save @angular/compiler-cli my 6 hour struggle ended. Now I can relax and enjoy my gaming night.
no worries bro. In code we believe/trust/live. What's your favorite game?
On Sep 15, 2017 9:04 PM, "Imran Khan" [email protected] wrote:
@intellix https://github.com/intellix
Thanks a million. After moving the compiler-cli to my dependencies and re-installing it with npm install --save @angular/compiler-cli my 6 hour struggle ended. Now I can relax and enjoy my gaming night.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/5654#issuecomment-329856369, or mute the thread https://github.com/notifications/unsubscribe-auth/AbgUzhPeJ_hSfP0CQccL6Aclk-3bBjxOks5sirxEgaJpZM4MpMsX .
@rickmutua Heroes of the Storm!
hey all,
I was sick of this kinda error. This whole process had me to install, uninstall, update etc a lot of time. but then I found the solution to this by following a few methods.
First of all, I found out that even after I had installed the @angular/cli globally my local setup wasn't able to identify a few of the dependencies like @angular/cli , @angular/compiler-cli, typescript, @angular/language-service. I found this out by executing the command "ng -v" in which it showed an error right beside these mentioned dependencies. Then I executed the command npm install @angular/cli@latest. That changed all my dependencies to v4.4.3 and all those dependencies were automatically shifted from devDependencies to Dependencies. and then when I execute "ng -v" it shows no error, all the dependencies along with their versions were displayed and finally my "ng serve " works great.
Note: It's just that some of the dependencies of angular/cli installed globally can't be fetched locally by the system and hence by installing them locally may do the trick...
Something to check - I noticed that I got this exact error message too when I forgot to run "npm install" first (whoops).
I had the same issue and I just solved it. It was related to the location of my new project. I can't create 2 angular-cli projects in the same directory.
This wasn't working for me : I tried to remove node_module and to run npm install, to reinstall @angular/compiler-cli, NOTHING WORKED. My problem was : I was trying to create a new angular-cli project in the same directory as an other angular-cli project (my first project was working). I noticed that running 'ng new my_project' was unuasually quick.
So I created a new folder somewhere else, and ran
ng new project_name cd project_name npm install ng serve
For some reason it works now.
Is it a bug report ? Have you guys suceeded to create several angular-cli projects in the same directory ?
I experienced this issue as well.
I'm not exactly sure how to reproduce it, but this is what happened:
- I got a project A created with Angular CLI, always working
- I updated my global cli and created a new project B
- Back in project A, I restarted the cli and then got this issue
To solve it, I just re-run npm install in project A (even though there wasn't anything new to install)
I got this issue after I installed [email protected]. After I ran 'npm install @angular/compiler-cli', the problem is solved. I assume it because [email protected] need other packages for higher version .
I know a way to reproduce/fix this BUG if you use ATOM.
I found my solution. The 'npm install' was not generating the same folders according to the command prompt I was using (default Windows Command Prompt VS Atom-IDE-Terminal) !!!
FROM THE WINDOWS COMMAND PROMPT : npm install created hundreds of folders in node_module. ng serve then works.
FROM THE ATOM COMMAND PROMPT : npm install is much quicker (bad sign) and only create 10 folders in node_module. ng serve FAILS.
I guess again it has something to do with permissions, and is probably not related to angular-cli.
EDIT : Now trying ng new project_name with default windows command prompt. It's long but ng serve it works.
With ATOM : it's quicker but ng serve doesn't work.
If you are using windows, just check you are using the default command prompt to run npm install. That solved the issue for me
Could you check that your "@angular/compiler" in your dependencies is compatible with angular/cli version:
https://stackoverflow.com/a/47328497/2633707
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.