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

start project failed

Open kamalkech opened this issue 9 years ago • 30 comments

OS

Windows 10

Versions.

angular-cli: 1.0.0-beta.28.3 node: 6.9.4 os: win32 x64

Repro steps.

ng serve

The log given by the failure.

ERROR in ./~/@angular/core/src/util/decorators.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\core\src\util\decorators.js Parenthesized pattern (156:12) You may need an appropriate loader to handle this file type. | if (clsDef.hasOwnProperty('extends')) { | if (typeof clsDef.extends === 'function') { | ((constructor)).prototype = proto = | Object.create(((clsDef.extends)).prototype); | } @ ./~/@angular/core/src/util.js 9:0-42 @ ./~/@angular/core/src/core.js @ ./~/@angular/core/index.js @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/@angular/core/src/di/forward_ref.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\core\src\di\forward_ref.js Parenthesized pattern (24:4) You may need an appropriate loader to handle this file type. | */ | export function forwardRef(forwardRefFn) { | ((forwardRefFn)).forward_ref = forwardRef; | ((forwardRefFn)).toString = function () { return stringify(this()); }; | return (((forwardRefFn))); @ ./~/@angular/core/src/di.js 14:0-65 @ ./~/@angular/core/src/core.js @ ./~/@angular/core/index.js @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/@angular/core/src/facade/errors.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\core\src\facade\errors.js Parenthesized pattern (60:32) You may need an appropriate loader to handle this file type. | * @return {?} | */ | set: function (value) { ((this._nativeError)).stack = value; }, | enumerable: true, | configurable: true @ ./~/@angular/core/src/application_ref.js 15:0-53 @ ./~/@angular/core/src/core.js @ ./~/@angular/core/index.js @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/@angular/compiler/src/aot/static_reflector.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\compiler\src\aot\static_reflector.js Parenthesized pattern (793:4) You may need an appropriate loader to handle this file type. | function positionalError(message, fileName, line, column) { | var /** @type {?} */ result = new Error(message); | ((result)).fileName = fileName; | ((result)).line = line; | ((result)).column = column; @ ./~/@angular/compiler/index.js 30:0-61 @ ./~/@angular/platform-browser-dynamic/src/platform-browser-dynamic.js @ ./~/@angular/platform-browser-dynamic/index.js @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/@angular/compiler/src/jit/compiler.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\compiler\src\jit\compiler.js Parenthesized pattern (283:12) You may need an appropriate loader to handle this file type. | assertComponent(compMeta); | var /** @type {?} / HostClass = function HostClass() { }; | ((HostClass)).overriddenName = identifierName(compMeta.type) + "_Host"; | var /* @type {?} */ hostMeta = createHostComponentMeta(HostClass, compMeta); | compiledTemplate = new CompiledTemplate(true, compMeta.selector, compMeta.type, hostMeta, ngModule, [compMeta.type]); @ ./~/@angular/compiler/index.js 36:0-49 @ ./~/@angular/platform-browser-dynamic/src/platform-browser-dynamic.js @ ./~/@angular/platform-browser-dynamic/index.js @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/@angular/platform-browser/src/browser/browser_adapter.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\platform-browser\src\browser\browser_adapter.js Parenthesized pattern (88:75) You may need an appropriate loader to handle this file type. | * @return {?} | / | BrowserDomAdapter.prototype.setProperty = function (el, name, value) { ((el))[name] = value; }; | /* | * @param {?} el @ ./~/@angular/platform-browser/src/browser.js 12:0-62 @ ./~/@angular/platform-browser/src/platform-browser.js @ ./~/@angular/platform-browser/index.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/@angular/platform-browser/src/dom/dom_renderer.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\platform-browser\src\dom\dom_renderer.js Parenthesized pattern (321:8) You may need an appropriate loader to handle this file type. | / | DomRenderer.prototype.setElementProperty = function (renderElement, propertyName, propertyValue) { | ((renderElement))[propertyName] = propertyValue; | }; | /* @ ./~/@angular/platform-browser/src/browser.js 18:0-71 @ ./~/@angular/platform-browser/src/platform-browser.js @ ./~/@angular/platform-browser/index.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/@angular/compiler/src/facade/errors.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\compiler\src\facade\errors.js Parenthesized pattern (60:32) You may need an appropriate loader to handle this file type. | * @return {?} | */ | set: function (value) { ((this._nativeError)).stack = value; }, | enumerable: true, | configurable: true @ ./~/@angular/compiler/src/util.js 13:0-44 @ ./~/@angular/compiler/index.js @ ./~/@angular/platform-browser-dynamic/src/platform-browser-dynamic.js @ ./~/@angular/platform-browser-dynamic/index.js @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/json3/lib/json3.js Module parse failed: C:\Projets\Angular\formation\node_modules\json3\lib\json3.js Parenthesized pattern (89:12)

You may need an appropriate loader to handle this file type. | if (stringifySupported) { | // A test function object with a custom toJSON method. | (value = function () { | return 1; | }).toJSON = value; @ ./~/sockjs-client/lib/main.js 7:12-28 @ ./~/sockjs-client/lib/entry.js @ (webpack)-dev-server/client/socket.js @ (webpack)-dev-server/client?http://localhost:4200/ @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./~/@angular/common/src/facade/errors.js Module parse failed: C:\Projets\Angular\formation\node_modules@angular\common\src\facade\errors.js Parenthesized pattern (60:32) You may need an appropriate loader to handle this file type. | * @return {?} | */ | set: function (value) { ((this._nativeError)).stack = value; }, | enumerable: true, | configurable: true @ ./~/@angular/common/src/pipes/invalid_pipe_argument_error.js 13:0-45 @ ./~/@angular/common/src/pipes/async_pipe.js @ ./~/@angular/common/src/pipes/index.js @ ./~/@angular/common/src/common.js @ ./~/@angular/common/index.js @ ./~/@angular/platform-browser/src/browser.js @ ./~/@angular/platform-browser/src/platform-browser.js @ ./~/@angular/platform-browser/index.js @ ./src/app/app.module.ts @ ./src/main.ts @ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

any idea ?

kamalkech avatar Feb 02 '17 23:02 kamalkech

I've managed to get it running. Delete your node_modules folder after creating a project with ng new proj-name and modify the rxjs entry (line 24) on package.json removing the "^" before it. It should look like: "rxjs": "5.0.1",. Re-run npm install and ng serve should work fine.

Edit: Forgot to add, I'm running the latest build 1.0.0-beta.29

arthur-melo avatar Feb 03 '17 00:02 arthur-melo

As a temporary solution just update acorn package to 4.0.7

ykravv avatar Feb 03 '17 00:02 ykravv

I managed to fix it with @AbbTek 's solution. Changed the version of devDependencies: "@angular/compiler-cli": "2.4.5",

RomainGoncalves avatar Feb 03 '17 00:02 RomainGoncalves

The problem was indeed in acorn, one of WebPack's dependencies and should be fixed by doing:

$ rm -rf node_modules
$ npm install

Or just:

$ npm install [email protected]

beeman avatar Feb 03 '17 00:02 beeman

Closing this as the fix above should work.

hansl avatar Feb 03 '17 00:02 hansl

@beeman runing server of angular-cli work good now, but after update files ts webpack not compile them !! and i already install [email protected]

kamalkech avatar Feb 03 '17 01:02 kamalkech

added "acorn": "4.0.7" to package.json fixed this issue for me

dsoltesz avatar Feb 03 '17 02:02 dsoltesz

Thank you so, SO much @beeman and @EvgenyKravchenko, all working now... was frustrating me for the past 4 hours. 😛 ❤️

colintucker avatar Feb 03 '17 05:02 colintucker

Short offtopic question before this issue dissapears forever: Did you guys notice the difference in speed in recompiling? That was the one and only reason I updated the cli hehe

denkomanceski avatar Feb 03 '17 09:02 denkomanceski

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.