upgrade npm install npm sha512 error

Possibly save 1 hour of your time: For some reason trying to upgrade my npm gives a weird error about sha512 – npm ERR! code EINTEGRITY.

Solution:

Deleting npm and npm-cache folders in Users%username%\AppData\Roaming (windows 10) and running npm install fixed it for me

  npm install npm@latest -g

Book – Node.js in Practice

Advertisements

SSIS error 0xC0011008 “the package failed to load due to error error loading from xml”

Possibly save 2 hours of your time: If you are starting a new SSIS project in Visual Studio, you may encounter this error.

Note: If you get error 0xC0011008 such as “the package failed to load due to error error loading from xml”, ensure you are targeting the right version of database via project properties. Right click the Project (not Solution) and choose Properties. In my case, I am using SQL Server 2012.

targetserverversion

Book – Professional Microsoft SQL Server 2012 Integration Services

SSIS – Failed to start project Exception deserializing the package “Value does not fall within the expected range”

Possibly save 1 hour of your time: I got this error after making some changes to packages.

I replace with version control one and still got this error. So I then look at other changes I have made.

I created lots of stuff. I have the luxury to revert my code based on source control. And the error goes away.

Later on as I add my code back, I discover the error has to do with SMTP connection manager used for sending email. I linked this connection manager to Send Mail Task Editor.

There is a bug when you setup your SMTP connection manager at the project level.

Bug:

https://social.technet.microsoft.com/Forums/WINDOWS/en-US/0fcddaaf-813c-48dc-a40b-c0f9aa396fa2/smtp-connection-level-project-doesnt-work?forum=sqlintegrationservices

Solution:

It will work if you change it to the package level.

Versions:

After you check your version number using Add/Remove Programs, you can compare your version here at

https://docs.microsoft.com/en-us/sql/ssdt/changelog-for-sql-server-data-tools-ssdt

I am running

  • SSDT 17.2 for Visual Studio 2015
    Build number: 14.0.61707.300

 

Book: Professional Microsoft SQL Server 2012 Integration Services

SSIS – read a file based on file name parameter

Possibly save 1 hour of your time: There are times you will need to read a file and process the data in it.

In this scenario, there is an input for the file name with path and an output with the second line parsed.

 

public void Main()
{
			// TODO: Add your code here

                using (var reader = new StreamReader(Dts.Variables["SupportListFile"].Value.ToString()))
                {
//custom code to read first and second line
//read first line
                    reader.ReadLine();
//read second line
                    var list = reader.ReadLine();

//assign output variable
                    if (!string.IsNullOrEmpty(list))
                        Dts.Variables["SupportList"].Value = list;
                }

            Dts.TaskResult = (int)ScriptResults.Success;
}

Understanding Typescript

Possibly save 1 hour of your time: Here are some reminders when using Typescript.

  • Resource Link – Create variable using let rather than var:

https://www.typescriptlang.org/docs/handbook/variable-declarations.html

  • Resource Link – Include other javascript by using node.js npm to install both the library itself and typed-definition for the library. In this example, I am installing mapbox-gl and its typed-definition. You can go to https://www.npmjs.com and find your typed-definition.

  npm install mapbox-gl

  npm install –save @types/mapbox-gl

If you cannot find it in npm package manager, you can try Typed definition in github.

 

 

Understanding Stencil.js

Possibly save 1 hour of your time: Here are some resources that I have used to learn Stencil.js.

Decorators

  • @Prop
    • Props are custom attribute/properties exposed publicly on the element.
    • string, number, boolean, object, array
    • Children components should not know about or reference parent components, so Props should be used to pass data down from the parent to the child.
    • By default, when a member decorated with a @Prop() decorator is set, the component will efficiently re-render.
    • It’s important to know, that @Prop is immutable from inside the component logic. Once a value is set by a user, the component cannot update it internally.
    • Within the component class, the Props are accessed via the this operator.
    • Externally, Props are set on the element.
    • They can also be accessed via Javascript from the element.
  • @PropWillChange and @PropDidChange
  • @State
    • can be used to manage internal data for a component. This means that a user cannot modify the property from outside the component, but the component can modify it how ever it sees fit.
    • Any changes to a @State() property will cause the components render function to be called again.
  • @Method
    • used to expose methods on the public API.
    • Functions decorated with the @Method() decorator can be called directly from the element.

 

Videos

Announcement

https://www.youtube.com/watch?v=UfD-k7aHkQE

Getting Started

https://www.youtube.com/watch?v=MqMYaT1GlWY

 

Articles

Understanding Component, Prop, State, Event, EventEmitter, Listen:

https://coryrylan.com/blog/create-your-first-web-component-with-stencil-js

Understanding Constructor:

https://codecraft.tv/blog/2017/10/10/smile-to-unlock-webcomponent-stenciljs/

Understanding :

https://www.javascripttuts.com/creating-a-todo-application-using-stencil/

 

Lots of resources here:

https://github.com/mappmechanic/awesome-stenciljs/

Node.js npm cannot install fsevents node modules

Possibly save 1 hour of your time: When you want to use node.js npm package manager to install dependencies, you may encounter the following error when you run:

  npm install

fsevents node_modules.png

Check your npm version:

  npm -v

Revert to a version that works. I am using npm 5.0.4:

npm i -g npm@5.0.4

You can also check your any version dependency at global level:

  npm list -g

If the above doesn’t work, then you can upgrade npm version to latest as follows:

  npm install npm@latest -g

Related resource: https://github.com/npm/npm/issues/17671

 

Understanding Javascript Library Frameworks

Possibly save 1 hour of your time: There are many javascript libraries and frameworks. Which one will you use?

I have compiled some really good links below from others sites on recent trends. Please note they are not my work.

Angular vs. React vs. Vue: A 2017 comparison

https://medium.com/unicorn-supplies/angular-vs-react-vs-vue-a-2017-comparison-c5c52d620176

Vue.js Is Good, But Is It Better Than Angular Or React?

https://www.valuecoders.com/blog/technology-and-apps/vue-js-comparison-angular-react/

Book JavaScript Frameworks for Modern Web Dev