Angular6 getting error when building site for production - angular6

I was using Angular: 6.0.3 and when I updated my angular using npm update I am getting error when I am trying to build site for production.
When I am running command:
ng build --prod
I am getting error:
ERROR in ./src/app/app.module.ngfactory.js Module build failed: TypeError: Cannot read property '_statSync' of undefined
Current angular version is: 6.1.10
Full error you can see it here:Full error report link

That error is because of the version of cache-loader in package.json file. just run npm update and you will get cache-loader 1.2.5 they have fixed this in updated version.

Related

In every new project after npm install this error occur when i run the project

In every new project after npm install this error occur when i run the project
Error: multi (webpack)-dev-server/client?http://0.0.0.0:0&sockPath=/sockjs-node ./node_modules/#angular/material/prebuilt-themes/indigo-pink.css ./node_modules/bootstrap/dist/css/bootstrap.min.css ./src/styles.scss ../node_modules/font-awesome/css/font-awesome.css
Module not found: Error: Can't resolve 'E:\subha jha\subha useful\slfr\node_modules\font-awesome\css\font-awesome.css' in 'E:\subha jha\subha useful\slfr\lokfr-repo'

polymer-cli build fails for element starter template

I am trying to create a reusable component using polymer cli.
I would like to use this component into another project where i can include it as a single file import.
But when I am trying to build the project, it keeps failing.
Below are details of my environment.
$node --version
v4.6.0
$ npm --version
2.15.9
$ polymer --version
0.16.0
$ polymer init
? Which starter template would you like to use? element
info: Running template element...
? Element name (my-el)
$polymer build
$ polymer build
info: Building application...
info: Generating build/unbundled...
info: Generating build/bundled...
error: Uncaught exception: Error: file path is not in root: /Users/yogeshkulkarni/workspace/polymer/polymer/polymer.html (/Users/yogeshkulkarni/workspace/polymer/my-el)
error: Error: file path is not in root: /Users/yogeshkulkarni/workspace/polymer/polymer/polymer.html (/Users/yogeshkulkarni/workspace/polymer/my-el)
at Object.urlFromPath (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/path-transformers.js:41:15)
at StreamAnalyzer.getFile (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:107:39)
at StreamResolver.accept (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:210:34)
at FileLoader.request (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/node_modules/hydrolysis/lib/loader/file-loader.js:64:27)
at Analyzer.load (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/node_modules/hydrolysis/lib/analyzer.js:121:32)
at Analyzer._getDependencies (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/node_modules/hydrolysis/lib/analyzer.js:433:25)
at Analyzer._dependenciesLoadedFor (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/node_modules/hydrolysis/lib/analyzer.js:401:25)
at Analyzer._parseHTML (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/node_modules/hydrolysis/lib/analyzer.js:227:50)
at null._onTimeout (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/node_modules/hydrolysis/lib/analyzer.js:125:39)
at Timer.listOnTimeout (timers.js:92:15)
polymer-cli build works fine when I choose application starter template. Is polymer-cli doesn't support building element starter template?
I had similar problems. I used the polymer INIT - 'a blank application template', to create my project.
Which didn't provide a polymer.json configuration file. I added and configured this file. Now polymer BUILD is without any errors (in my project). Because polymer BUILD needs to know about your project structure. See https://www.polymer-project.org/1.0/toolbox/server
The docs for polymer-cli state:
This command is for app projects only.
And it currently doesn't provide a user-friendly error message for this scenario, so you'll see it crash with a stack trace when building element projects.

MSDeploy gulp build package

Is it possible to deploy a Single Page App project build using grunt to IIS using MSDeploy from TeamCity? The project is not any kind of Visual Studio solution and doesn't get built using MSBuild.
My Command parameters which are not working are:
-source:package='%teamcity.build.checkoutDir%\Dist.%build.number%.zip' -dest:auto,computerName="%system.MsDeployServiceUrl%",userName="%system.UserName%",password="%system.Password%",authtype="basic",includeAcls="False"
-verb:sync -setParamFile:"%teamcity.build.checkoutDir%\Dist.%build.number%.zip.SetParameters.xml"
-AllowUntrusted -setParam:"IIS Web Application Name"="%system.WebSiteName%" -verbose
The error I am getting is:
[11:47:31][Step 3/3] Error Code: ERROR_EXCEPTION_WHILE_CREATING_OBJECT
[11:47:31][Step 3/3] More Information: Object of type 'package' and
path 'D:\TeamCity\buildAgent\work\e2b0015b49d87e90\Dist.30.zip' cannot
be created. Learn more at:
http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_EXCEPTION_WHILE_CREATING_OBJECT.
[11:47:31][Step 3/3] Error: The Zip package
'D:\TeamCity\buildAgent\work\e2b0015b49d87e90\Dist.30.zip' could not
be loaded. [11:47:31][Step 3/3] Error: Could not find file
'D:\TeamCity\buildAgent\work\e2b0015b49d87e90\Dist.30.zip'.
[11:47:31][Step 3/3] Error count: 1. [11:47:31][Step 3/3] Process
exited with code -1 [11:47:31][Step 3/3] Step Deploy (Command Line)
failed
My build process is working as I end up with the correct artefacts, I just don't seem to be able to deploy my generated artefacts using MSDeploy
This is a screenshot of my artefacts:
I managed to get this working by changing my parameters to the following:
-source:iisapp='%teamcity.build.checkoutDir%\dist' -dest:iisapp='C:\www\xxxx-website',computerName="%system.MsDeployServiceUrl%",userName="%system.UserName%",password="%system.Password%",authtype="basic",includeAcls="False"
-verb:sync -AllowUntrusted -verbose
And changing my user to an admin user rather than an IIS user. Note use of iisapp - the key was to read the MSDeploy api using msdeploy -help
FYI - a good test is to use the intended command against msdeploy.exe in console and check output errors then push command into teamcity when it's working.
I created a grunt and gulp plugin to do just what you are looking to do. gulp-mswebdeploy-package and grunt-mswebdeploy-package will create a ms webdeploy package from any folder and do not require your build to be running on windows.
https://www.npmjs.com/package/gulp-mswebdeploy-package
https://www.npmjs.com/package/grunt-mswebdeploy-package

Not able to install and use Uniecart 2.2 on wamp

In backend i checked, the table are not creating and when installing stuck on same 2nd step page with an error in install.php.
error?: undefined exception

angular-route error Arguments to path.json must be strings

I am having a hard time figuring out what this error means.
I have the following bower.json:
...
"dependencies":{
"angular-route":"~1.2.18",
"angular":"~1.2.18"
}
Upon installing my bower packages through bower install I get the following error:
bower angular-route#~1.2.20 error Arguments to path.join must be strings
Stack trace:
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at GitHubResolver._checkout (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/lib/core/resolvers/GitHubResolver.js:54:21)
at /home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/lib/core/resolvers/GitResolver.js:69:21
at _fulfilled (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:798:54)
at self.promiseDispatch.done (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:827:30)
at Promise.promise.promiseDispatch (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:760:13)
at /home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:574:44
at flush (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/p-throttler/node_modules/q/q.js:108:17)
Console trace:
Trace
at StandardRenderer.error (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/lib/renderers/StandardRenderer.js:72:17)
at Logger.<anonymous> (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/bin/bower:111:22)
at Logger.EventEmitter.emit (events.js:95:17)
at Logger.emit (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/lib/commands/index.js:40:20
at _rejected (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/q/q.js:797:24)
at /home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/q/q.js:823:30
at Promise.when (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/q/q.js:1035:31)
at Promise.promise.promiseDispatch (/home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/q/q.js:741:41)
at /home/ubuntu/.nvm/v0.10.26/lib/node_modules/bower/node_modules/q/q.js:557:44
System info:
Bower version: 1.3.7
Node version: 0.10.26
OS: Linux 3.13.0-29-generic x64
Now, I have to mention that I have done the same thing for about a week, and everything was working correctly, with exactly the same setup.
I have noticed that https://github.com/angular/angular.js has released a new version 1.2.20 recently, but even installing that I get the same error.
Some context: I am using nodejs, express and angular in my application. I can provide more info if needed (e.g., package.json, main server file).
Any help would be highly appreciated.
See the answer here: Bower - error when installing package "Arguments to path.join must be strings"
Fix: bower cache clean and update to Bower 1.3.8.