Skip to content
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

Failed to start with TS2307: Cannot find module 'path'. #9151

Closed
humphrycc opened this issue Jan 10, 2018 · 6 comments
Closed

Failed to start with TS2307: Cannot find module 'path'. #9151

humphrycc opened this issue Jan 10, 2018 · 6 comments
Assignees
Labels
needs: more info Reporter must clarify the issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@humphrycc
Copy link

Versions

$ ng --version
    
Angular CLI: 1.6.3
Node: 6.9.5
OS: darwin x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.3
@angular-devkit/build-optimizer: 0.0.36
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.42
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.3
@schematics/angular: 0.1.11
@schematics/schematics: 0.0.11
typescript: 2.4.2
webpack: 3.10.0
npm -v
5.6.0
node -v
v6.9.5

Repro steps

When run npm start, failed with following errors:

** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
Date: 2018-01-10T05:57:58.228Z                                                       
Hash: 0924bf2d2d00305e83d8
Time: 7840ms
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 2.93 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 636 bytes [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 863 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 853 kB [initial] [rendered]

ERROR in node_modules/@angular/compiler-cli/src/transformers/program.d.ts(9,23): error TS2307: Cannot find module 'path'.


webpack: Failed to compile.
@clydin clydin added needs: more info Reporter must clarify the issue type: bug/fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Jan 10, 2018
@humphrycc
Copy link
Author

Resolved, remove typo import from source code:

import {exitCodeFromResult} from '@angular/compiler-cli';

@snowymike
Copy link

yep, i also got that rogue import somehow, and removing it also fixed the problem

@RichardZandi
Copy link

i also got this error. it was introduced while i was commenting on my code in app.module.ts. i used the word "build" in a comment and my editor auto imported: import {build} from 'ng-packagr';

which i didn't notice.

removing the import solved the problem.

@dipamar
Copy link

dipamar commented Dec 17, 2018

I also faced same issue due to typo import into the app.module.ts module. after removing it fixed the problem

@Shashidharankrish
Copy link

i also got the same error, it was created when i used the word random and counter. it went off when i removed the imported lines.

@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

No branches or pull requests

7 participants