Archive for 2018

May 29th, 2018
4:56 pm
Problems upgrading angular 5 project to angular 6, and upgrading angular on a PC

Posted under Angular & PrimeNG
Tags

I had serious issues trying to upgrade an existing project, and it was not clear online what I should do.

The main persistent error was:-

./node_modules/raw-loader!./node_modules/postcss-loader/lib??embedded!./node_modules/sass-loader/lib/loader.js??ref–8-3!./src/styles.scss
Module build failed: Error: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (64)
For more information on which environments are supported please see:
https://github.com/sass/node-sass/releases/tag/v4.8.3

The online information on this was not clear.

Initially I used a liberal combination of npm-update and npm-update –g on various things but still had the above error.

I reached a point of installing primeng successfully under angular 6 as detailed here.

I then tried hand editing the package.json file for the upgrade project, stealing the versions from the package.json for the primeng application. However this did not appear to help -I still had the above issues.

In the end a combination of the following resolved this:-

ng update @angular/cli

ng update @angular/cli

npm install –g node-sass@latest

npm install node-sass@latest

I think the key issue here was installing the latest node-sass. I also had some code errors to resolve in the application but I did mange to run it successfully.

No Comments »

May 23rd, 2018
7:51 pm
Installing and running the PrimeNG showcase locally under windows

Posted under Angular & PrimeNG
Tags , , ,

Update 23/5/2018

I retried this using Angular 6 and the latest primeng.

Step 2/ below was not needed, and I did not install/reinstall gulp per step 3/ (not used this time – need to check/confirm re this)

The wiki steps referred to below, here, referred to using sass to build the css, but this command did not work for me even when I installed the node.js sass per here -  the –update command came back with an error.

I then gave up using sass to compile the sass files.

Because of this issue I still had to fix the theming, so tried to copy the css files as below rather than compile the sass. This time the themes folder was under src\assets\components.

I therefore created another skeleton app, installed primeng using “npm install primeng”, and then copied the themes folder from under node_modules\primeng\resources  to src\assets\components, overwriting the themes already there.

This added the css files that were missing.

I could then run the showcase with theming fully working, either using “npm start” or “ng serve” – either worked.

I did notice that the theming borders on the treetable component did not appear to work, but apart from that all the theming including theme switching worked fine.

Original Post

It is useful to have this running locally in order to can try out occasional code hacks on the example code to try out ideas or check how things work if the docs are not clear on a point, knowing that you have started from a working example.

The steps for this basically follow the wiki steps here. Note the following additions/amendments to the steps:-

1/ I cloned the repository from here. Having cloned I then listed and disconnected from the remote repositories, as the clones were just for local use:-

git remote –v

git remote rm origin

git remote –v

2/ Dependencies as follows were added to package.json as per instructions:-

  "dependencies": {
      "@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/animations": "4.0.0",
      "core-js": "^2.4.1",
      "rxjs": "^5.2.0",
      "zone.js": "^0.8.4"
  },

Following this npm install was run to download all the dependencies

3/ In order to build using gulp as instructed (gulp build), I installed gulp first as per the instructions here:-

npm install --global gulp-cli
npm install --save-dev gulp

4/ I then ran npm start to run the showcase, which defaults to http://localhost:8080/

The showcase ran ok locally but there were some issues with the theming – the theme had a transluscent background on the menus and dropdowns for example which did not correctly occlude the text underneath. The live showcase on the PrimeNG site did not have this problem.

On investigation it appears that the theme files are under the main resources/themes directory, but are not being sass compiled from scss during the build so there are no .css files there. The gulp file for the project, gulpfile.js, does not have any entries that do sass compilation so this may be an omission/bug in the version I had downloaded.

The showcase does not use the primeng under node_modules – it defines its own primeng package such that if you try to enter npm install primeng to install the themes in the normal way as part of the npm installed package, you get an error from npm about the duplicate primeng.

My workaround was straightforward – I just copied the theme folder and all subfolders from under the node_modules\primeng\resources directory in another application folder to the projects top level resources directory (in fact I used the primeng-quickstart-webpack which I had already set up) – any other project where you have installed primeng will do. This solved the problem by providing all the css files for the themes, and the themes and theme switching then worked.

As I have no requirement to do a full working build for the showcase this is no problem.

I checked for other posts about theming issues and found a couple of StackOverflow posts about theme issues with Webpack here and here. These may prove relevant for future development.

No Comments »

March 10th, 2018
8:27 pm
Kodak i1150 scanner fails to connect/scan

Posted under 64 Bit & Windows & Windows 7
Tags ,

I hit  number of issues getting the scanner to work, even after an extended period where it had worked ok.

There were 3 main issues:-

  • During (re)installation of the software, a test scan is done and this typically failed. This was frustrating because when running the SVT diagnostics utility which came with the software, it would readily perform a scan and save a valid JPeg, indicating that there was nothing wrong with the base drivers. The solution to this was to do an advanced install, and just untick the scan test to allow the install to complete.
  • I often had issues where the Kodak ScanMate software (which allows scanning to PDF directly using the front panel of the scanner) refused to connect to the scanner. The main issue here was that the correct USB cable (with an inbuilt suppressor component) must be used – any other USB cable seems to be prone to error. In addition, I found that it helped to exit the ScanMate software from the tray, and restart it. This then gives a choice of either starting the scanner first or the software – it was not clear which was best, but at least this allowed a complete reset (especially after changing settings). I also disabled running ScanMate on windows startup. It is straightforward to run from the start menu when needed, which is not very often. I have also tried installing a later version of the drivers etc. (v2.2.6 rather than the v2.1 on the original delivered CD) but this does not appear to have done anything to improve the reliability (at least on Windows 7)
  • Having sorted the above and got to the point of performing a scan, I would often get an error whilst the PDF was being created “Failed to format images” after which the scan attempt just died. This link here details how to delete a sys folder to resolve the problem and this certainly helped – the folder however was in fact in C:\Users\SteveW\AppData\Local\Smart Touch\i11xx  in my case under windows 7. I had to exit ScanMate and disconnect the scanner to be able to delete the folder, and it was recreated automatically when I reconnected and restarted ScanMate. An additional issue was that using a high resolution in the settings definitely triggered the issue – to the point that my gut feel is that this may be a prime cause of the problem. It certainly failed  at 1200dpi, and the improvement in quality was hardly noticeable compared to 300dpi. Also a double sided A4 colour scan to PDF increased in size from around 5Mb to 25Mb so it was definitely not worth using. It also took a lot longer doing the conversion/saving at resolutions above 300dpi (and typically e.g. for 1200dpi, took a long time and then failed). In the end I stuck with 300dpi, and just wound the Jpeg quality up to best to help improve things. After this I was able to get reliable operation.

A backup plan if all else fails is to used the SVT diagnostics utility to scan to a JPeg (tweaking the settings allows colour or monochrome selection etc. but paper size appeared to be just automatic). I then used an upgraded version of PDFSam which allowed creation of a PDF directly from the JPeg. To to this I had to register PDFSam but it appears to allow PDF creation as a free option if you register. This worked fine as an emergency backup. The downer with this approach is that each page side gets saved to a separate file, so they all need pulling into the PDF separately with PDFSam – not an issue but a bit time consuming.

No Comments »

March 6th, 2018
6:31 pm
Windows 10 cannot connect to legacy Windows XP file share

Posted under Windows & Windows 10
Tags

When I first tried to do this from Windows 10, I just got the standard 8004005 unknown error which was not much help.

However when trying explicitly to map a network drive to the Windows XP pc, Windows 10 was more helpful, stating that it could not connect to a legacy SMB1 protocol server.

Todd Heron’s reply to this MS Technet post contains the answer:-

Go to Control Panel > Programs and Features > Turn Windows Features on or off > check or uncheck the box for “SMB 1.0/CIFS File Sharing Support”

Doing this in control panel solved the problem immediately – all the shares on the XP machine were visible as normal.

No Comments »