joaogarin / angular-electron

Angular2 and Electron starter using webpack
150 stars 53 forks source link

npm run build error #32

Closed afriedma closed 7 years ago

afriedma commented 7 years ago

Hi,

I have cloned the repo, npm install worked well, but I am getting below errors on npm run build, please advise.

WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 69:15 Critical dependency: the request of a dependency is an expression

WARNING in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 85:15 Critical dependency: the request of a dependency is an expression

ERROR in [default] C:\Users\afriedman\Dev\Javascript\angular2-electron\node_modules\@types\webpack\index.d.ts:6:0 Cannot find type definition file for 'uglify-js'.

ERROR in [default] C:\Users\afriedman\Dev\Javascript\angular2-electron\node_modules\@types\webpack\index.d.ts:7:0 Cannot find type definition file for 'tapable'.

ERROR in [default] C:\Users\afriedman\Dev\Javascript\angular2-electron\node_modules\@types\webpack\index.d.ts:9:26 Cannot find module 'uglify-js'.

ERROR in [default] C:\Users\afriedman\Dev\Javascript\angular2-electron\node_modules\@types\webpack\index.d.ts:10:25 Cannot find module 'tapable'.

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run " "build:dev" npm ERR! node v6.9.3 npm ERR! npm v3.10.10 npm ERR! code ELIFECYCLE npm ERR! angular2-electron@0.0.0 build:dev: webpack --progress --profile npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the angular2-electron@0.0.0 build:dev script 'webpack --progress --profile'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the angular2-electron package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webpack --progress --profile npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs angular2-electron npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls angular2-electron npm ERR! There is likely additional logging output above.

joaogarin commented 7 years ago

Hello,

I just tried a fresh install and it worked fine..I am not on Windows tough, so maybe thats related. It looks like a problem with @types. Can you try removing the node_modules folder and running npm install again see if it works?

If not if you do find the problem It would be great if you could report it back, I dont really have a Windows so cant reproduce this =/

Thanks! ;)

afriedma commented 7 years ago

The problem only occurs on Windows. To fix it, you need to add

"typeRoots": [ "../node_modules/@types" ]

to tsconfig.json

joaogarin commented 7 years ago

Thaks I will include that as It is something that makes sense for all platforms.