How to install a NativeScript plugin from a forked repository? - nativescript

I currently need to use the nativescript-https plugin but its repository is not updated and not packed to npm and it has a couple bugs (including one with AFNetworking with version) without a solution so I've forked the repository and try to add from this forked repo using:
tns pluging add [url of the repo]
this install the plugin with no errors, but when I try to run the app it shows the following error:
NativeScript encountered a fatal error: Error: Could not find module 'nativescript-https'
So I would like to know... which is the correct workflow to do this?

Compile and add the plugin folder to your package.json using relative path.
"myplugin": "file:myplugin/dist"
Assuming myplugin is your plugin folder placed at your project root, dist is where you have your compiled JS files.

The error wasn't related to the plugin installation, the problem was that I needed to run Typescript compiler on plugin's folder to generate the .js files.

Related

yarn workspaces dependency install location issue

I have a project that uses yarn workspaces. The structure of the project is:
package.json
packages
- project A
- project B
- project C
When I run yarn install, the packages are installed in the project root node_modules. Recently I added another project (D) and ran yarn install. With project D, some of it's dependencies where installed in projectD/node_modules so I have some dependencies in the root and some dependencies in projectD and it's causing errors when I run the project.
Is there anyway I can "force" yarn to install all dependencies in the root node_modules?
I've just had this problem myself. It sounds like you have a version mismatch between a dependency of projectD, and a dependency of your other projects. The error you mention may identify what the dependency is (as it will give a 'cannot resolve module' error I'm guessing), otherwise you may find what's installed in projectD's node_modules folder will identify it.
Once identified I'd go through your yarn.lock file and work out which package/s have a dependency on the mismatching version. You may then find that updating the package that has the older version fixes your issue, or you may decide it's better to the use the nohoist option of workspaces
See:
https://dev.to/michalbryxi/share-common-code-with-yarn-workspaces-5g29
https://yarnpkg.com/blog/2018/02/15/nohoist/

SublimeLinter ESLint couldn't find the plugin

When editing javascript files in Sublime Text Editor 3.x, I get the error:
Oops! Something went wrong! :(
ESLint: 6.0.1.
ESLint couldn't find the plugin "eslint-plugin-chai-expect".
(The package "eslint-plugin-chai-expect" was not found when loaded as a Node module from the directory "C:\workspace\flltools".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install eslint-plugin-chai-expect#latest --save-dev
The plugin "eslint-plugin-chai-expect" was referenced from the config file in "modules\scoring\.eslintrc.yml".
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
I tried multiple solutions I found online, including removing global ESLint/moving all ESLint related packages to be global, to altering the SublimeLinter.settings file. The problem only occours when running lint through Sublime. When I run eslint command, it works perfectly.
If anyone has any idea why this is happenning please help me!
Thank you
As far as I can tell this is indeed a problem with migrating to ESLint v6. But it's not a global installation problem.
The problem is now that ESLint looks in the working directory where the eslint command is run from. As you say in your comment:
It seems to be looking in a parent folder (as you can see in the error it's looking in c:/workspace/flltools, whereas my project is in c:/workspace/flltools/modules/scoring
So your editor is running eslint in the parent directory rather than in the directory where the package.json file is. I'm guessing your editor has the project root one level higher than where the package.json file is.
It does look like this has now been patched in the SublimeLinter plugin via github issue #1626: Wrong working directory on nested local eslint installs (breaks eslint#6)
Note that I have similar issues with both VSCode and Vim, so it's not a specifically a Sublime Text thing, more just an ESLint thing.
In the ESLint v6 migration doc, it has a section on "Plugins and shareable configs are no longer affected by ESLint’s location". It suggests:
If you use a config file located outside of a local project (with the --config flag), consider installing the plugins as dependencies of that config file, and setting the --resolve-plugins-relative-to flag to the location of the config file.
This --resolve-plugins-relative-to will fix the problem in that you can specify the path to where the package.json is inside there.
Most probably you have updated your ESLint to v6.
As per Migrating to 6.0 Docs
If you use a global installation of ESLint (e.g. installed with npm install eslint --global) along with plugins.
Then you should install those plugins locally in the projects where you run ESLint.
In your case, Install eslint-plugin-chai-expect and other plugins(if used) as devDependencies locally to your project.
npm install --save-dev eslint-plugin-chai-expect
If your config file extends shareable configs and/or parsers, you should ensure that those packages are installed as dependencies of the project containing the config file.

the "hero" component of iris not installed when using "dep" to manage project dependencies

this question also posted here: https://github.com/kataras/iris/issues/1081
I am using "iris" as the MVC framework in my golang project, and i use "dep" to manage the dependencies of my project.
the "iris" dependency was configured in "Gopkg.toml" as bellow:
and later i use "dep ensure -v" to download all the dependencies.
after the "ensure" command finished, i check the downloaded files in "vendor/github.com/kataras/iris/hero" folder, i found there is no source code files were downloaded, refer to the screen capture bellow:
so i cannot use "hero" component in my project, because the "hero" related package not installed in my project.
thanks all for your help ~
I'm very new to Go; but I had a similar issue with another library 'https://github.com/jedib0t/go-pretty'
$ dep ensure -add github.com/jedib0t/go-pretty
"github.com/jedib0t/go-pretty" is not imported by your project, and has been temporarily added to Gopkg.lock and vendor/.
If you run "dep ensure" again before actually importing it, it will disappear from Gopkg.lock and vendor/.
The repo is cloned into pkg/dep/sources/https---github.com-jedib0t-go--pretty/ however there is no Go code in vendor/github.com/jedib0t/go-pretty/
I added an import "github.com/jedib0t/go-pretty" into one of my source code files and ran dep ensure -v however the vendor copy does not have any Go code it it. I removed the folder and tried again however same result.
What solved it for me was specifically importing the package I wanted into my code eg: "github.com/jedib0t/go-pretty/table" and running dep ensure -v again. I'm not sure why it worked but maybe my experience can help you or someone else.

Build React Native project after pulling from GitHub

My friend initialized a GitHub repo after initializing React Native in a certain directory. After I pull his files into a directory and initialize a local repository on my computer and run the XCode project, there seem to be a lot of missing files and the build fails. There's probably something I need to do which is taken care of when setting up react native in the "react-native init AwesomeProject" step, but I'm not trying to set up a new project. Instead, I want to keep the files he's already developed, but set up the React Native "environment"..how would I go about doing this?
You need to install the dependencies through npm. Just enter the following command in the root directory of your project:
npm i

Build fails on older Git branch after checking out another with build.gradle specifying newest version of Sass jar

I upgraded my local Compass and Sass to their latest versions and fixed some errors caused by deprecated code per the latest Sass (3.4.9). I checked those into a branch and the changes include updating a build.gradle file in which it specifies a Sass jar also of the latest version (This was created and uploaded to nexus by another co-worker). For testing, I had another co-worker, who is using an older version of Sass, check out my branch. It built fine. But when he switched back to another branch, it failed, showing the same errors I got after I updated Sass. We verified he is still using Sass 3.2.1. I had him remove a cached file (sass-3.4.9.gem) and directory (sass-3.4.9). The build still failed. I'm not at all familiar with build.gradle files and such. I'm hoping anyone has insight on what happened and how to fix this.
EDIT: Below are two error examples. All the other errors I get refer to not being able to extend a class -
Building > :compileSassWARNING: The compass/css3/box module is DEPRECATED and will be removed in the next release. Please use compass/css3/flexbox instead.
on line 4 of /Library/Ruby/Gems/1.8/gems/compass-core-1.0.1/stylesheets/compass/css3/_box.scss
from line 11 of /Users/sueannaj/dev/workspace/zephyr_css/scss/sass/shared/includes/_imports.scss
from line 14 of /Users/sueannaj/dev/workspace/zephyr_css/scss/sass/twitter-main.scss
error scss/sass/t-store-main.scss (Line 6 of scss/sass/touch/modules/sub/_default-buttons.scss: ".button-group" failed to #extend ".tabbed-layout".
The selector ".tabbed-layout" was not found.
Use "#extend .tabbed-layout !optional" if the extend should be able to fail.
For reference, I'm on Mac 10.8.5 and ruby 1.8.7. Someone here figured a fix, and I will answer my own question.
There were two cached files and one directory that needed removing -
~/.gradle/caches
.gradle
build
The last two, .gradle and build, live in the project directory. .gradle/caches is in the user's home directory.

Resources