angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

The "@angular/compiler-cli" package was not properly installed.

Open jmendiara opened this issue 9 years ago • 17 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

$ ng --version
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.0
node: 6.10.0
os: darwin x64
@angular/common: 4.0.1
@angular/compiler: 4.0.1
@angular/core: 4.0.1
@angular/forms: 4.0.1
@angular/http: 4.0.1
@angular/platform-browser: 4.0.1
@angular/platform-browser-dynamic: 4.0.1
@angular/router: 4.0.1
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.1

OS: MAC OS Yosemite

Repro steps.

$ ng new --link-cli true --style scss --routing true learn-ng
installing ng
  create .editorconfig
 [...]
Successfully initialized git.
Installing packages for tooling via yarn.
Installed packages for tooling via yarn.
Successfully linked to @angular/cli.
Project 'learn-ng' successfully created.
$ cd learn-ng
$ npm start

The log given by the failure.

> [email protected] start /Users/javier/Documents/Proyectos/learn-ng
> ng serve

The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.
    at Object.<anonymous> (/Users/javier/.nvm/v6.10.0/lib/node_modules/@angular/cli/node_modules/@ngtools/webpack/src/index.js:14:11)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/javier/.nvm/v6.10.0/lib/node_modules/@angular/cli/tasks/eject.js:10:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)

Desired functionality.

Work out of the box

Mention any other details that might be useful.

$ ng new  --style scss --routing true learn-ng

Works ok

jmendiara avatar Apr 01 '17 07:04 jmendiara

The --link-cli option is intended for use only when developing the CLI itself. It does not provide any benefit otherwise.

clydin avatar Apr 01 '17 09:04 clydin

thanks @clydin! Maybe'd be useful to state it clearly in the cli runtime or remove from "production" build and move to dev documentation?

jmendiara avatar Apr 01 '17 14:04 jmendiara

@jmendiara agreed. I made this same mistake too following the upgrade instructions.

bafinneg avatar Apr 05 '17 04:04 bafinneg

Same error here, any fix for this?

jobnte avatar Apr 08 '17 20:04 jobnte

What is the solution , guys?

jamilalisgandarov avatar Apr 09 '17 16:04 jamilalisgandarov

@jmendiara The --link-cli option should only be mentioned in the Development Hints section of the README. If it is erroneously located anywhere else please let us know, so that it can be corrected.

If the --link-cli option was used and you wish to reverse it in a generated app, you should be able to run npm unlink @angular/cli within project.

clydin avatar Apr 10 '17 12:04 clydin

I have the same problem, any fix?

-- update the solution --

I solved installing the latest version of typescript

edmilsonlani avatar Apr 10 '17 17:04 edmilsonlani

I have same problem, installing how "npm install -g typescript" and "npm install -g @angular/cli"

$ ng -v @angular/cli: 1.0.0 node: 7.8.0 os: linux x64 @angular/common: 4.0.1 @angular/compiler: 4.0.1 @angular/core: 4.0.1 @angular/forms: 4.0.1 @angular/http: 4.0.1 @angular/platform-browser: 4.0.1 @angular/platform-browser-dynamic: 4.0.1 @angular/router: 4.0.1 -->@angular/cli: error -->@angular/compiler-cli: error

my package.json

{ "name": "helloworld", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", "core-js": "^2.4.1", "rxjs": "^5.1.0", "zone.js": "^0.8.4" }, "devDependencies": { "@angular/cli": "1.0.0", "@angular/compiler-cli": "^4.0.0", "@types/jasmine": "2.5.38", "@types/node": "~6.0.60", "codelyzer": "~2.0.0", "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-coverage-istanbul-reporter": "^0.2.0", "protractor": "~5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.2.0" } }

diogoab avatar Apr 11 '17 02:04 diogoab

I just create a new project without using quickstart of angular and it works!

2017-04-10 21:55 GMT-05:00 Diogo Alves Barbosa [email protected]:

I have same problem, installing how "npm install -g typescript" and "npm install -g @angular/cli"


/ \ _ __ __ _ _

| | __ _ _ __ / | | | | / △ \ | ' \ / _| | | | |/ _ | '| | | | | | | / ___ | | | | (| | || | | (| | | | | | |___ | | // __| ||_, |,|*|,|| _|**|*| |__/ @angular/cli: 1.0.0 node: 7.8.0 os: linux x64 @angular/common: 4.0.1 @angular/compiler: 4.0.1 @angular/core: 4.0.1 @angular/forms: 4.0.1 @angular/http: 4.0.1 @angular/platform-browser: 4.0.1 @angular/platform-browser-dynamic: 4.0.1 @angular/router: 4.0.1 -->@angular/cli: error -->@angular/compiler-cli: error

my package.json

{ "name": "helloworld", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/common": "^4.0.0", "@angular/compiler": "^4.0.0", "@angular/core": "^4.0.0", "@angular/forms": "^4.0.0", "@angular/http": "^4.0.0", "@angular/platform-browser": "^4.0.0", "@angular/platform-browser-dynamic": "^4.0.0", "@angular/router": "^4.0.0", "core-js": "^2.4.1", "rxjs": "^5.1.0", "zone.js": "^0.8.4" }, "devDependencies": { "@angular/cli": "1.0.0", "@angular/compiler-cli": "^4.0.0", "@types/jasmine": "2.5.38", "@types/node": "~6.0.60", "codelyzer": "~2.0.0", "jasmine-core": "~2.5.2", "jasmine-spec-reporter": "~3.2.0", "karma": "~1.4.1", "karma-chrome-launcher": "~2.0.0", "karma-cli": "~1.0.1", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", "karma-coverage-istanbul-reporter": "^0.2.0", "protractor": "~5.1.0", "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.2.0" } }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/5790#issuecomment-293135536, or mute the thread https://github.com/notifications/unsubscribe-auth/AQTkyl61OqEJ_OvnqnrMpLyOLAx_Lyh4ks5ruuu7gaJpZM4MwZdP .

jobnte avatar Apr 11 '17 04:04 jobnte

I had the same issue while I updated my project to angular 4. I updated the typescript ref in the devDependencies from "~2.0.0" to "~2.1.5". Issue solved.

tobi-or-not-tobi avatar Apr 11 '17 13:04 tobi-or-not-tobi

thanks for response, I try to go with this info 👍

diogoab avatar Apr 11 '17 16:04 diogoab

See http://stackoverflow.com/questions/43351136/the-angular-compiler-cli-package-was-not-properly-installed/43351137#43351137

JanStureNielsen avatar Apr 11 '17 16:04 JanStureNielsen

In my case there was a problem with npm, it didn't install devDependencies. I found the solution here:

http://stackoverflow.com/questions/34700610/npm-install-wont-install-devdependencies

I check if npm config production value is set to true with: npm config get production If true, I set to false with: npm config set -g production false

but I don't know why my npm was configured with the production value to true. I haven't set NODE_ENV environment variable, neither used the "--production" flag

ajbello avatar Apr 27 '17 12:04 ajbello

I'm closing this issue because the original issue received answers by @clydin and now people are just reporting different problems. Please open new issues instead of replying to this one.

filipesilva avatar May 04 '17 14:05 filipesilva

Finally found the solution see the below screenshots and steps to resolve this issue http://itechiesol.blogspot.com/2017/07/angular-compiler-cli-package-was-not.html

naru6be avatar Jul 22 '17 17:07 naru6be

This works like magic

npm install --save-dev del

blinks32 avatar Aug 04 '17 17:08 blinks32

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.