angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.77k stars 11.98k forks source link

use command "npm run start" #5659

Closed ghost closed 7 years ago

ghost commented 7 years ago

Bug Report or Feature Request (mark with an x)

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

Versions.

@angular/cli: 1.0.0
node: 6.10.1
os: win32 x64
@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
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0

Repro steps.

ng new myitem
cd myitem
npm run start 

The log given by the failure.

> webpack-dev-server --port=4200

 10% building modules 3/3 modules 0 activeProject is running at http://localhost:4200/
webpack output is served from /
Hash: fda8bf4d3e4d40b9f7a5
Version: webpack 2.2.1
Time: 4907ms
chunk    {0} styles.bundle.js, styles.bundle.js.map (styles) 9.79 kB {2} [initial] [rendered]
   [36] ./src/styles.css 1.15 kB {0} [built]
   [37] ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader!./src/styles.css 235 bytes {0} [built]
   [40] ./~/css-loader/lib/css-base.js 1.46 kB {0} [built]
   [80] ./~/style-loader/addStyles.js 6.91 kB {0} [built]
   [90] multi (webpack)-dev-server/client?http://localhost:4200 ./src/styles.css 40 bytes {0} [built]
chunk    {1} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 40 bytes {2} [initial] [rendered]
   [89] multi (webpack)-dev-server/client?http://localhost:4200 ./src/polyfills.ts 40 bytes {1} [built]
chunk    {2} inline.bundle.js, inline.bundle.js.map (inline) 301 kB [entry] [rendered]
   [10] (webpack)-dev-server/client?http://localhost:4200 4.9 kB {2} [built]
   [38] ./~/ansi-html/index.js 4.26 kB {2} [built]
   [39] ./~/ansi-regex/index.js 135 bytes {2} [built]
   [42] ./~/events/events.js 8.33 kB {2} [built]
   [43] ./~/html-entities/index.js 231 bytes {2} [built]
   [47] ./~/punycode/punycode.js 14.7 kB {2} [built]
   [50] ./~/querystring-es3/index.js 127 bytes {2} [built]
   [53] ./~/sockjs-client/lib/entry.js 244 bytes {2} [built]
   [62] ./~/sockjs-client/lib/transport-list.js 613 bytes {2} [built]
   [79] ./~/strip-ansi/index.js 161 bytes {2} [built]
   [82] ./~/url/url.js 23.3 kB {2} [built]
   [83] ./~/url/util.js 314 bytes {2} [built]
   [84] (webpack)-dev-server/client/overlay.js 3.59 kB {2} [built]
   [85] (webpack)-dev-server/client/socket.js 856 bytes {2} [built]
   [86] (webpack)/hot/emitter.js 77 bytes {2} [built]
     + 69 hidden modules
chunk    {3} main.bundle.js, main.bundle.js.map (main) 40 bytes [initial] [rendered]
   [88] multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts 40 bytes {3} [built]

ERROR in multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts
Module not found: Error: Can't resolve 'C:\Users\Administrator\Desktop\angularcli1.0.0+angular4\angular-cli\packages\@ngtools\webpack\src\index.ts' in 'C:\Users\Administrator\Desktop\angularcli1.0.0+angular4\-angulr-cli1.0.0-angular4\angular4j'
 @ multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts

ERROR in multi (webpack)-dev-server/client?http://localhost:4200 ./src/polyfills.ts
Module not found: Error: Can't resolve 'C:\Users\Administrator\Desktop\angularcli1.0.0+angular4\angular-cli\packages\@ngtools\webpack\src\index.ts' in 'C:\Users\Administrator\Desktop\angularcli1.0.0+angular4\-angulr-cli1.0.0-angular4\angular4j'
 @ multi (webpack)-dev-server/client?http://localhost:4200 ./src/polyfills.ts

Child html-webpack-plugin for "index.html":
    chunk    {0} ./index.html 352 bytes [entry] [rendered]
        [0] ./~/html-webpack-plugin/lib/loader.js!./src/index.html 352 bytes {0} [built]
webpack: Failed to compile.

Desired functionality.

Mention any other details that might be useful.

but use ng serve not have ERROR

>ng serve
** NG Live Development Server is running on http://localhost:4200 **
Hash: eb5950b42f5ef9424062
Time: 11812ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 158 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 3.69 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 9.77 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 2.37 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.
hansl commented 7 years ago

It looks like C:\Users\Administrator\Desktop\angularcli1.0.0+angular4\-angulr-cli1.0.0-angular4\angular4j tries to import the @ngtools/webpack/src/index.ts, but it's not there (if you are using NPM, it should be javascript, not .ts extension.

The errors come from your web pack code, not the project. I don't think we can help you there, as it's likely not an error on our part, but an error from the angular4j code.

ghost commented 7 years ago

thank you for your time

angular-automatic-lock-bot[bot] commented 5 years ago

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.