Skip to content

Angualr CLI commands not working after trying to upgrade to latest (webpack) #1931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
theunreal opened this issue Sep 1, 2016 · 13 comments
Closed

Comments

@theunreal
Copy link

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    All ng commands not working
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

trying to upgrade from angular cli webpack 10 to 11

  1. The log given by the failure. Normally this include a stack trace and some
    more information.

image

@solms
Copy link

solms commented Sep 1, 2016

It seems like it could be related to #1883 ?

TL;DR: I think you need to update your Node to version 6.x.x.

Edit:
Yip - updating Node from v4.x.x to v6.4.0 did the trick for me.

@web-dave
Copy link

web-dave commented Sep 1, 2016

same here. working hard to fix my machine. I Need it to talk at a meetup about cli!!!!

Windows 10
Node V4.5.0
npm 3.8.7

Last command i tryed before it breaks was to install angular-cli 1.0.0-beta.11-webpack.3.

@web-dave
Copy link

web-dave commented Sep 1, 2016

@solms Node Version greater 4 not working with node-sass!! I try to reinstall node.

@theunreal
Copy link
Author

theunreal commented Sep 1, 2016

Upgrading to node 6 resolved this issue but remains another

image

@web-dave
Copy link

web-dave commented Sep 1, 2016

Reinstall node 4.5 doesn't solve the problm, intall node 6.5 doesn't solve th Problem!!

I get into Panic cause of the talk i give next week.

@web-dave
Copy link

web-dave commented Sep 1, 2016

I fixed my machine npm install -g [email protected]
ng v
angular-cli: 1.0.0-beta.11-webpack.2
node: 4.5.0
os: win32 ia32 but now no .d.ts file found

@manuelxtrem
Copy link

manuelxtrem commented Sep 1, 2016

Updating node to v6 also did work for me too, but another issue has risen, as @theunreal had:

Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at Object.getWebpackCommonConfig (C:\Projects\Team Projects Workspace\Workplace Suite - Angular\node_modules\angular
-cli\addon\ng2\models\webpack-build-common.ts:23:25)
at new NgCliWebpackConfig (C:\Projects\Team Projects Workspace\Workplace Suite - Angular\node_modules\angular-cli\ad
don\ng2\models\webpack-config.ts:13:30)
at Class.run (C:\Projects\Team Projects Workspace\Workplace Suite - Angular\node_modules\angular-cli\addon\ng2\tasks
\serve-webpack.ts:19:22)
at C:\Projects\Team Projects Workspace\Workplace Suite - Angular\node_modules\angular-cli\addon\ng2\commands\serve.t
s:84:26
at process._tickCallback (internal/process/next_tick.js:103:7)

@nhenneaux
Copy link

nhenneaux commented Sep 1, 2016

You should update your angular-cli.json file with the new version.

{
  "project": {
    "version": "1.0.0-beta.11-webpack.8",
    "name": "ng2-cli-webpack-8"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": "assets",
      "index": "index.html",
      "main": "main.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.json",
      "prefix": "app",
      "mobile": false,
      "styles": [
        "styles.css"
      ],
      "scripts": [],
      "environments": {
        "source": "environments/environment.ts",
        "prod": "environments/environment.prod.ts",
        "dev": "environments/environment.dev.ts"
      }
    }
  ],
  "addons": [],
  "packages": [],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "prefixInterfaces": false,
    "lazyRoutePrefix": "+"
  }
}

@manuelxtrem
Copy link

manuelxtrem commented Sep 1, 2016

Changed the version to "version": "1.0.0-beta.11-webpack.8", but same error

angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: win32 x64

Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at Object.getWebpackCommonConfig (C:\Projects\Team Projects Workspace\Workplace Suite - Angular\node_modules\angular
-cli\addon\ng2\models\webpack-build-common.ts:23:25)
at new NgCliWebpackConfig (C:\Projects\Team Projects Workspace\Workplace Suite - Angular\node_modules\angular-cli\ad
don\ng2\models\webpack-config.ts:13:30)
at Class.run (C:\Projects\Team Projects Workspace\Workplace Suite - Angular\node_modules\angular-cli\addon\ng2\tasks
\serve-webpack.ts:19:22)
at C:\Projects\Team Projects Workspace\Workplace Suite - Angular\node_modules\angular-cli\addon\ng2\commands\serve.t
s:84:26
at process._tickCallback (internal/process/next_tick.js:103:7)

@web-dave
Copy link

web-dave commented Sep 1, 2016

Change the package.json. set TypeScript Version from ^2.0.0 to 2.0.0.

This solved my Problem

AND node Version v4.5

@jminuscula
Copy link

jminuscula commented Sep 5, 2016

I was having the same problem; fixed it by updating theangular-cli.json carefully as suggested by @nhenneaux. Some attributes such styles or scripts are mandatory.

@manuelxtrem check for apps[0].styles in your angular-cli.json. It's what's making the build fail.

@filipesilva
Copy link
Contributor

The latest beta.14 should have fixed these issues. See https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.12 on how to update.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants