Sunday 19 March 2017

npm run build doesn't work with PowerShell ISE

I have a NodeJS project in Windows environment and I'm using Visual Studio and Power Shell ISE. In my package.json I have the following scripts:

"scripts": {
    "start": "node ./bin/www",
    "build": "del-cli public/js/app && webpack --config webpack.config.dev.js --progress --profile --watch",
    "build:prod": "del-cli public/js/app && ngc -p tsconfig.aot.json && ngc -p tsconfig.aot.json && webpack --config webpack.config.prod.js --progress --profile --bail && del-cli 'public/js/app/**/*.js' 'public/js/app/**/*.js.map' '!public/js/app/bundle.js' '!public/js/app/*.chunk.js' 'assets/app/**/*.ngfactory.ts' 'assets/app/**/*.shim.ts'"
}

In the Power Shell, if I do "npm build" and then npm start, all go well and I update my server code running. But like this I need to restart all the process every time that I make a change. I saw a video that I could do "npm run build" and the process would keep running.

But when I do "npm run build" it all go well but the following:

...
building modules 541/542 modules 1 active 
...er\src\animation\styles_collection.js
70% building modules 542/542 modules 0 active
12151ms building modules
At line:1 char:1
+ npm run build
+ ~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: ( ...uilding modules:String) [], 
RemoteException
+ FullyQualifiedErrorId : NativeCommandError
 71% sealing
...

Then it continues until the end without any more exceptions but I think this error is not allowing the building to keep running because I still need to stop the npm process and restart it. Any one who can help me on this? Thanks in advance.



via Daniel SerrĂ£o

No comments:

Post a Comment