Angular-cli: error after updating to 6.0.0-rc.1

Created on 6 Apr 2018  Â·  11Comments  Â·  Source: angular/angular-cli

Versions

_                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
/ â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
/ ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
|___/

Angular CLI: 6.0.0-rc.1
Node: 8.9.1
OS: win32 x64
Angular: 6.0.0-rc.1
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router, upgrade

@angular/cdk: 6.0.0-rc.0
@angular/flex-layout: 5.0.0-beta.14
@angular/material: 6.0.0-rc.0
@angular-devkit/architect: 0.5.1
@angular-devkit/build-angular: 0.5.1
@angular-devkit/build-optimizer: 0.5.1
@angular-devkit/core: 0.5.1
@angular-devkit/schematics: 0.5.1
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 6.0.0-rc.1
@schematics/angular: 0.5.1
@schematics/update: 0.5.1
typescript: 2.7.2
webpack-bundle-analyzer: 2.10.0
webpack: 4.5.0

Repro steps

  • Install project using angular-cli 1.6.8 on windows
  • npm install angular-cli@next and latest angular packages
  • run ng update @angular/cli --migrate-only --from=1.6.8 command
  • ng serve

Observed behavior

> ng serve --proxy-config proxy.config.json

** Angular Live Development Server is listening on localhost: 4200, open your browser on http://localhost:4200/ **
Date: 2018-04-06T16:42:07.104Z
Hash: 98214584febaabfd54d1
Time: 147074ms
chunk {main} main.js, main.js.map (main) 1.99 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 711 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.09 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 1.67 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 325 kB [initial] [rendered]

ERROR in ENOENT: no such file or directory, stat 'C:\C\Users\username\Documents\Projects\projectname\src\app\app.module.ts'
i ï½¢wdmï½£: Failed to compile.

Desired behavior


The extra C/\ should be removed from the C:\C\Users path so app.module.ts can be found.

Mention any other details that might be useful (optional)

When I initially updated to 6.0.0-rc.1 I did not get a warning to run ng update. I only ran that because ng serve was not working.

repro steps 2 (required) broken

Most helpful comment

Actually, I cannot generate any project in 6.0.0-rc.2. ng new projname ouput:

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\WINDOWS\system32\cmd.exe ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

I'm working on a Windows 10 machine:

Angular CLI: 6.0.0-rc.2
Node: 8.11.1
OS: win32 x64

All 11 comments

I tried reverting my changes, updating to cli v1.7.1 and reinstalling but still ran into the no such file error.

username@WUSusername-4IJ MINGW64 ~/Documents/Projects/projectname (angular-6)
$ npm i @angular/cli@latest
npm WARN rm not removing C:\Users\username\Documents\Projects\projectname\node_modules\.bin\ng.cmd as it wasn't installed by C:\Users\username\Documents\Projects\projectname\node_modules\@angular\cli
npm WARN rm not removing C:\Users\username\Documents\Projects\projectname\node_modules\.bin\ng as it
wasn't installed by C:\Users\username\Documents\Projects\projectname\node_modules\@angular\cli

> [email protected] install C:\Users\username\Documents\Projects\projectname\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\username\AppData\Roaming\npm-cache\node-sass\4.8.3\win32-x64-57_binding.node

> [email protected] postinstall C:\Users\username\Documents\Projects\projectname\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\username\Documents\Projects\projectname\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine

+ @angular/[email protected]
added 58 packages, removed 445 packages, updated 85 packages and moved 11 packages in 1242.258s



username@WUSusername-4IJ MINGW64 ~/Documents/Projects/projectname (angular-6)
$ ng update @angular/cli
Your global Angular CLI version (6.0.0-rc.1) is greater than your local
version (1.7.4). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
  update package.json (3827 bytes)

added 2 packages and updated 15 packages in 347.661s

up to date in 127.43s

up to date in 132.184s



username@WUSusername-4IJ MINGW64 ~/Documents/Projects/projectname (angular-6)
$ ng update @angular/cli --next
Your global Angular CLI version (6.0.0-rc.1) is greater than your local
version (1.7.4). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".
  update package.json (3971 bytes)
npm WARN deprecated [email protected]: This version is deprecated. Please use the latest version of rxjs.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must
install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer
dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.

added 2 packages, removed 574 packages and updated 22 packages in 782.505s
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must
install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer
dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.

up to date in 95.844s
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must
install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer
dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.

up to date in 77.447s



username@WUSusername-4IJ MINGW64 ~/Documents/Projects/projectname (angular-6)
$ npm start

> [email protected] start C:\Users\username\Documents\Projects\projectname
> ng serve --proxy-config proxy.config.json

An old project has been detected, which needs to be updated to Angular CLI 6.

Please run the following commands to update this project.

  ng update @angular/cli --migrate-only --from=1.7.1
  npm i
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `ng serve --proxy-config proxy.config.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\username\AppData\Roaming\npm-cache\_logs\2018-04-06T21_16_54_924Z-debug.log



username@WUSusername-4IJ MINGW64 ~/Documents/Projects/projectname (angular-6)
$ ng update @angular/cli --migrate-only --from=1.7.1
            Updating karma configuration
            Updating configuration
            Removing old config file (.angular-cli.json)
            Writing config file (angular.json)
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\windows\system32\cmd.exe ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)



username@WUSusername-4IJ MINGW64 ~/Documents/Projects/projectname (angular-6)
$ npm i

> [email protected] install C:\Users\username\Documents\Projects\projectname\node_modules\node-sass
> node scripts/install.js

Cached binary found at C:\Users\username\AppData\Roaming\npm-cache\node-sass\4.8.3\win32-x64-57_binding.node

> [email protected] postinstall C:\Users\username\Documents\Projects\projectname\node_modules\node-sass
> node scripts/build.js

Binary found at C:\Users\username\Documents\Projects\projectname\node_modules\node-sass\vendor\win32-x64-57\binding.node
Testing binary
Binary is fine
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must
install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/core@^5.0.0 but none is installed. You must install peer
dependencies yourself.
npm WARN @angular/[email protected] requires a peer of @angular/common@^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 601 packages in 595.465s



username@WUSusername-4IJ MINGW64 ~/Documents/Projects/projectname (angular-6)
$ npm start

> [email protected] start C:\Users\username\Documents\Projects\projectname
> ng serve --proxy-config proxy.config.json

** Angular Live Development Server is listening on localhost: 4200, open your browser on http://localhost:4200/ **
Date: 2018-04-06T21:40:24.334Z
Hash: 053d3b816f83a9527bf9
Time: 229877ms
chunk {main} main.js, main.js.map (main) 1.99 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 711 bytes [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 5.09 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 1.64 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 325 kB [initial] [rendered]

ERROR in ENOENT: no such file or directory, stat 'C:\C\Users\username\Documents\Projects\projectname\src\app\app.module.ts'
i ï½¢wdmï½£: Failed to compile.

username@WUSusername-4IJ MINGW64 ~/Documents/Projects/projectname (angular-6)
$ ng -v

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / â–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 6.0.0-rc.2
Node: 8.9.1
OS: win32 x64
Angular: 6.0.0-rc.2
... animations, cli, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router
... upgrade

@angular/cdk: 5.2.1
@angular/flex-layout: 5.0.0-beta.14
@angular/material: 5.2.1
@angular-devkit/architect: 0.5.4
@angular-devkit/build-angular: 0.5.4
@angular-devkit/build-optimizer: 0.5.4
@angular-devkit/core: 0.5.4
@angular-devkit/schematics: 0.5.4
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 6.0.0-rc.2.4
@schematics/angular: 0.5.4
@schematics/update: 0.5.4
typescript: 2.7.2
webpack-bundle-analyzer: 2.10.0
webpack: 4.5.0

Possibly related to #8989

Actually, I cannot generate any project in 6.0.0-rc.2. ng new projname ouput:

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\WINDOWS\system32\cmd.exe ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

I'm working on a Windows 10 machine:

Angular CLI: 6.0.0-rc.2
Node: 8.11.1
OS: win32 x64

@julianobrasil See this: https://github.com/angular/angular-cli/issues/10206
Your problem should be fixed in the next release.

@chrste90 I don't understand. Doesn't that issue recommend downgrading to the version I'm using?

@aciccarello do you still get this problem with rc.2 inside your upgraded project? I couldn't repro this myself on my windows machine.

I encountered it with both rc.1 and rc.2

If it helps, here is my .angular-cli.json pre-upgrade. I can try clearing my package-lock.json file and seeing if reinstalling dependencies fixes it.

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "projectname"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "data",
        "WEB-INF",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.app.json",
      "testTsconfig": "tsconfig.spec.json",
      "prefix": "pn",
      "styles": [
        "styles.scss"
      ],
      "scripts": [
      ],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [
    {
      "project": "src/tsconfig.app.json"
    },
    {
      "project": "src/tsconfig.spec.json"
    },
    {
      "project": "e2e/tsconfig.e2e.json"
    }
  ],
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "scss",
    "serve": {
        "port": 4200,
        "host": "localhost"
    }
  }
}

@aciccarello I tried using the .angular-cli.json you provided in a 1.7 project, update it with 6.0.0-rc.4, then running serve and I did not get the error you had.

Is your project up somewhere that I can look at?

Heya, I haven't heard back from you in a while so I am closing this issue. Please open a new issue if you're still having a problem.

Sorry, I thought I responded but apparently did not. Clearing out my node_modules and package-lock.json seemed to fix the issue so it must have been a dependency problem.

Thanks again for investigating thoroughly 🌹

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._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hartjo picture hartjo  Â·  3Comments

NCC1701M picture NCC1701M  Â·  3Comments

MateenKadwaikar picture MateenKadwaikar  Â·  3Comments

rajjejosefsson picture rajjejosefsson  Â·  3Comments

purushottamjha picture purushottamjha  Â·  3Comments