How to fix error Cannot find name 'object' in angular 2 cli ckeditor - node.js

I have insalled ng2-ckeditor using cli :
npm install ng2-ckeditor --save
Then Include CKEditor javascript files in my index file :
<script src="https://cdn.ckeditor.com/4.5.11/full/ckeditor.js"></script>
Then imported module in module file:
import { CKEditorModule } from 'ng2-ckeditor';
in imports "CKEditorModule"
and trying to use in html
It show error:
ERROR in
/var/www/html/eventswebsite/frontendapp/node_modules/ng2-ckeditor/lib/ckeditor.component.d.ts
(43,26): Cannot find name 'object'.
"ng2-ckeditor/lib/ckeditor.component.d.ts (43,26): Cannot find name
'object'."
its working if i change
ckeditorInit(config: object)
To
ckeditorInit(config: any)
in npm module ckeditor component file.

I am posting this answer for those who are facing this error "Cannot find name 'object'" irrespective of which component they are getting this error in. This is a tsc compiler version related issue. 'object' is keyword in TS2.2.
I am using VS 2017 Community. By default it shipped with tsc 1.5 ie. typescript compiler version 1.5. I tried updating it from Nuget and also installed "typescript for VS 2017" nothing helped, even though my computer had latest version of typescript, but VS typescript version was still 1.5.
Then I searched for Microsoft's latest update of VS 2017, fortunately for me notification of latest release was found on top bar of VS. After installing the latest update I got my typescript version on VS updated to 2.2. This resolved the issue and compilation errors were gone.
As a side note, you can find the version of typescript VS is using under menu "Help\About Microsoft Visual Studio", then on pop up screen scroll down a bit as shown in below image:

Related

"Unknown compiler option 'preserveValueImports'.ts" error when making a sveltekit project

Whenever I create a sveltekit project with tyepscript, I always have the "Unknown compiler option 'preserveValueImports'.ts" appear in the tsconfig.json file. The error appears over the '"strict": true' line as seen in the image.
I'm using typescript version 4.9.4 and have tried to downgrade it to 4.8.4, but the error still persists. This is my first time trying out sveltekit and typescript, so I'm not sure if I installed them wrong, but all I did was installed typescript globally with npm and then created svelte project with pnpm. I also had created the svelte project with npm but the error still appears.
This error was solved on reddit by updating visual studio code to the latest version (1.74.2), as VS code uses the bundled version of typescript by default.

Can't install M2MQTT Nuget package to Xamarin.iOS

When installing the Nuget package for M2MQTT 4.3 to my Xamarin.iOS project, I get the following error:
Could not install package 'M2Mqtt 4.3.0'. You are trying to install
this package into a project that targets 'Xamarin.iOS,Version=v1.0',
but the package does not contain any assembly references or content
files that are compatible with that framework.
However, 4.2 works fine. I have seen this error pop up for some other packages too, and my Nuget is up to date. This error shows up when I try to install in VS2017 on Windows and also on Visual Studio for Mac.
Should it be possible to build the package myself from source, and if so, what do I need to change to make it compatible (assuming that the library doesn't actually use part of .NET that Xamarin.iOS doesn't support)?
The reason I need to update is that on 4.2 I get the following error when trying to create a MqttClient:
The type 'IPAddress' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System, Version=3.9.0.0...'
and my hope is that this error will be resolved in the newest version.

How can I update com.android.support:exifinterface version

Currently I am using Android Studio 2.3.3. I wanted to update the support library version from 25.3.1 to 26.0.1. So inside my build.gradle file I did all the necessery changes and changed all the support library versions from 25.3.1 to 26.0.1. After that when I synced the project it shows me an error(I have given a screenshot) in compile 'com.android.support:appcompat-v7:26.0.1
All com.android.support libraries must use the exact same version...Found versions 26.0.1,25.3.1.Examples include com.android.support:animated-vector-drawable:26.0.1 and com.android.support:exifinterface:25.3.1
The error screen
My question is that where can I find com.android.support:exifinterface to update
I tried the same in Android Studio 3.0.0. That showed the same error
Try this:~
compile 'com.android.support:design:26.0.0-alpha1'

Node Sass No Binding for Your current environment

I've seen quite a few of these questions on SO, but none seem to solve or match the problem.
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x. The odd thing is, I don't have Node.js 6.x installed. From the command line, node -v gives me v5.10.1.
I'm the Angular4 Universal Asp.net core visual studio 2017 template straight out of the box.
I've tried
npm rebuild node-sass --force
Reordering node in Web External toolsin Visual Studio
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HL4JSD9SSV8E": An unhandled exception was thrown by the application.
System.Exception: Call to Node module failed with error: Prerendering failed because of error: Error: Module build failed: Error: Missing binding D:\Projects\angular2\node_modules\node-sass\vendor\win32-x64-48\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 6.x
Found bindings for the following environments:
Windows 64-bit with Node.js 5.x
This usually happens because your environment has changed since running npm install.
Run npm rebuild node-sass --force to build the binding for your current environment.
at module.exports (D:\Projects\angular2\node_modules\node-sass\lib\binding.js:15:13)
at Object. (D:\Projects\angular2\node_modules\node-sass\lib\index.js:14:35)
Where have I gone wrong?
On Visual Studio 2017 (15.4.1) you should go to:
Tools > Configure External Tools > Projects and Solutions > Web Package Management > External Web Tools
Then reorder the tools as seen below.
This worked for me.
Deleting node_modules folder and re-installing npm modules using npm install worked for me.
Visual Studio ships it's own version of Node embedded so that's why you see a mismatch.
The TROUBLSHOOTING guide in the repo covers how to work around this https://github.com/sass/node-sass/blob/master/TROUBLESHOOTING.md#using-node-sass-with-visual-studio-2015-task-runner

npm not installing jsdom in Windows

Im building an app in node.js with jQuery, but when I try to execute, it says it couldnt find module jsdom so, even though I dont understand why installing jQuery didnt install this dependency, I run manually npm install jsdom and I get this error message:
MSBUILD : error MSB3428: Could not load the Visual C++ component
"VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2)
install Microsoft Visual Studio 2005 or 3) add the location of t he
component to the system path if it is installed elsewhere.
[C:\Sites\myapp\node_modules\jsdom\node_modules\contextify\build\binding.sln]
I tried the first option, but still didnt help. What am I (missing|doing wrong)?
You're not the only one having issues with installing jsdom on windows. You could try these instructions:
http://www.steveworkman.com/node-js/2012/installing-jsdom-on-windows/
or use Cheerio which is easier to install on windows and does a similar job.

Resources