Node package manager keeps on loading in installing package depenencies - json

I am studying node js and I created a package.json like this:
{
"name": "NodeExpress",
"version": "0.1.0",
"description": "My Simple Express",
"main": "app.js",
"author": {
"name": "My Name",
"email": "name#email.com"
},
"dependencies": {
"express": "*",
"jade": "*",
}
}
When I checked my node_modules it has all the dependencies I need but in my console it's just loading. What does it mean? Is it still downloading?
When I checked the time it is almost 20 minutes past away since I install the dependencies.
Is it fine if I stop the execution of node packager installer?

Related

Load composer package from private gitlab

In my composer setup I load packages from 2 repos. One composer repo and a private gitlab repo. When I try to do a composer install on my local windows machine, I get the following error messages:
GitLab: The project you were looking for could not be found. fatal:
Could not read from remote repository. Please make sure you have the
correct access rights and the repository exists. ... The requested
package sv-test/testextension could not be found in any version, there
may be a typo in the package name.
Authentification is done via lokal ssh-key and password, that doesnt seem to be the problem. Whats wrong with my setup?
The composer.json of the project looks like this:
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org/"
},
{
"type": "git",
"url": "git#gitlab.xydevbox.de:sv-test/Testproject.git"
}
],
"name": "svdev/master-dev-box",
"description": "",
"type": "project",
"license": "MIT",
"homepage": "https://www.xydevbox.de/",
"authors": [
{
"name": "Sacha Vorbeck",
"email": "sacha.vorbeck#xydevbox.de",
"homepage": "https://www.xydevbox.de/",
"role": "Developer"
}
],
"require": {
"sv-testbox/testextension": "*",
"helhum/typo3-console": "^4.5",
"typo3/cms": "^8.7"
},
"config": {
"sort-packages": true,
"process-timeout": 2000,
"preferred-install": {
"typo3/cms": "source",
"*": "dist"
}
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
}
}
}
The composer.json from the package to be included from the gitlab private repo looks like this:
{
"name": "sv-testbox/testextension",
"type": "typo3-cms-extension",
"description": "",
"homepage": "https://www.xydevbox.de/",
"license": ["GPL-2.0+"],
"keywords": ["TYPO3 CMS"],
"version": "master",
"dist": {
"url": "git#gitlab.xydevbox.de:sv-test/Testproject.git",
"type": "git"
}
}
Maybe the latest composer version 1.5.2 is something for you if you take a look at the release notes
Fixed GitLabDriver looping endlessly in some conditions
Fixed
GitLabDriver support for unauthenticated requests
Fixed GitLab zip
downloads not triggering credentials prompt if unauthenticated
Fixed
path repository support of COMPOSER_ROOT_VERSION, it now applies to
all path repos within the same git repository
Fixed path repository
handling of copies to avoid copying VCS files and others
Fixed
sub-directory call to ignore list and create-project commands as well
as calls to Composer using --working-dir
Fixed invalid warning
appearing when calling remove on an non-stable package
https://github.com/composer/composer/releases
Thank you Georg and NextThursday. With some help on TYPO3 slack I finally got it running. The replace part was missing. I also learned that one should not edit composer.json files manually - always use the command line options to modify it. This example: https://github.com/TYPO3-Console/TYPO3-Console/blob/master/composer.json was also helpful.
project composer.json:
{
"repositories": [
{
"type": "composer",
"url": "https://composer.typo3.org/"
},
{
"type": "vcs",
"url": "https://github.com/svorbeck/masterconfig"
}
],
"name": "svorbeck/demo",
"description": "",
"type": "project",
"license": "MIT",
"homepage": "https://xydevbox.de/",
"authors": [
{
"name": "Sacha Vorbeck",
"email": "sacha.vorbeck#xydevbox.de",
"role": "Developer"
}
],
"require": {
"svorbeck/masterconfig": "dev-master",
"typo3/cms": "^8.7"
},
"config": {
"sort-packages": true,
"process-timeout": 2000,
"preferred-install": {
"typo3/cms": "source",
"svorbeck/masterconfig": "source",
"*": "dist"
}
},
"extra": {
"typo3/cms": {
"cms-package-dir": "{$vendor-dir}/typo3/cms",
"web-dir": "web"
},
"helhum/typo3-console": {
"install-extension-dummy": "0"
}
}
}
ext composer.json:
{
"name": "svorbeck/masterconfig",
"type": "typo3-cms-extension",
"description": "svorbeck master configuration",
"require": {
"typo3/cms-core": "^8.7"
},
"replace": {
"masterconfig": "self.version",
"svorbeck/masterconfig": "self.version"
}
}

How do you get Feathersjs offline-realtime syncing working with aurelia-cli

Windows 10 x64
aurelia-cli 0.31.3
feathers-client 2.3.0
feathers-offline-realtime 0.1.2
I am trying to get feathers-offline-realtime to work with aurelia-cli but I keep getting error.
------- File not found or not accessible ------
Location: D:/Development/animals-r-people-too/just-shelter/client/node_modules/feathers-offline-realtime/lib/commons/utils.js
Make sure that it is configured in aurelia.json and that it is not a Node.js package
Calling page
import realtime from 'feathers-offline-realtime'
I have added feathers-offline-realtime to aurelia.json
{
"name": "feathers-offline-realtime",
"main": "index",
"path": "../node_modules/feathers-offline-realtime/lib",
"resources": []
},
{
"name": "feathers-commons",
"main": "index",
"path": "../node_modules/feathers-commons/lib",
"deps": ["utils"],
"resources": []
},
{
"name": "utils",
"main": "index",
"path": "../node_modules/feathers-commons/commons/utils",
"resources": []
},
Using webpack (non aurelia-cli) just requiring feathers-offline-realtime works fine.

Getting extension from private repo with composer

I have to create a private yii2 extension on BitBucket, and install it in my projects with composer.
The SSH is set up correctly as far as I can understand, it was not at first - and I got an error "repo not found or you do not have permission" (or something of the kind).
The composer finds the composer.json, I removed it to test and I got an error message that "valid composer.json not found".
Now when i run composer update in my Git Bash it just prints "Nothing to install or update" and nothing appears in my vendor/ folder.
I have no errors to go on here, any ideas are mostly welcome!
I've set up the repo and added the following files:
composer.json
{
"name": "ext. name",
"type": "yii2-extension",
"description": "My desc",
"authors": [
{
"name": "Jorgen",
"email": "jorgen#domain.com",
"homepage": "http://www.domain.com"
}
],
"minimum-stability": "stable",
"support": {
"source": "bitbucket.org/companyname/yii2-extensionname"
},
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "2.0.*"
},
"autoload": {
"psr-4": {
"companyname\\extensionname\\": ""
}
}
}
.gitignore
vendor/**
models/Test.php
<?php
namespace companyname\extensionname\models;
class Test
{
}
And I've added the following to my Yii2 project composer.json:
"repositories": [
{
"type": "vcs",
"url": "ssh://git#bitbucket.org/companyname/yii2-extensionname",
}
],
Update
So I figured out that if I add my repo in this format it's found and downloaded, but the autoloader-psr4.php file is not updated with my autoloading.
"repositories": [
{
"type": "package",
"package": {
"name": "vendor/yii2-extension-name",
"version": "master",
"source": {
"type": "git",
"url": "git#bitbucket.org:vendor/yii2-extension-name",
"reference": "origin/master"
}
}
}
When I have
"repositories": [
{
"type": "git",
"url": "https://bitbucket.org/vendor/yii2-extension-name"
}
],
I get the following error:
Problem 1
- The requested package vendor/yii2-extension-name could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion for more details.
Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
There is no typos, its found and downloaded when I use "package". But then the autoloader is not updated.I've also tried all sorts of variations with git#, https and ssh. It always works as a package, never as a git or vcs.
Edit: oh, and minimum-stability is set to dev while troubleshooting.
You must use the correct name:
{
"name": "vendor/yii2-extension-name",
"type": "yii2-extension",
That is usually your Bitbucket username followed by the name of your repository.
That will work with your repositories Composer setting:
"repositories": [
{
"type": "git",
"url": "https://bitbucket.org/vendor/yii2-extension-name"
}
],

Openshift runs my connect(); and disconnect(); functions too late

I deployed my 7mb app into openshift and heroku. It works fine on heroku but on openshift it takes almost 2 minutes to run my io.sockets.on('connection', function(socket){}); and socket.on('disconnect', function () {}); functions(Other socket functions run fast enough). This causes huge problems because I use setTimeFout function in my code.
Note: While pushing my files to openshift I used to get
" openshift failed to execute 'control start' node-modules/bin/express
"
error. So I deleted express file at "myapp/node-modules/bin/express" and it worked.
Versions:
ruby: 1.9.3p0
node: 5.3.0
socket.io: 1.3.7
express: 3.0.0
My package.json file for openshift is as following.(I don't have much information about preparing json file so I use default one)
{
"name": "OpenShift-Sample-App",
"version": "1.0.0",
"description": "OpenShift Sample Application",
"keywords": [
"OpenShift",
"Node.js",
"application",
"openshift"
],
"author": {
"name": "OpenShift",
"email": "ramr#example.org",
"url": "http://www.openshift.com/"
},
"homepage": "http://www.openshift.com/",
"repository": {
"type": "git",
"url": "https://github.com/openshift/origin-server"
},
"engines": {
"node": ">= 0.6.0",
"npm": ">= 1.0.0"
},
"dependencies": {
"express": "~3.4.4"
},
"devDependencies": {},
"bundleDependencies": [],
"private": true,
"main": "server.js"
}
Thus my actual question is;
Does openshift normally runs these functions that slow or is it happening because of my mistakes?
Edit: The delay time is decreased from 2 minutes to 14 seconds. Eventhough I didn't change or repush anything.
Edit2: The delay time for connection is decreased from 14 seconds to 9 seconds by itself. And the delay time for disconnection still takes 2 minutes. My players have to wait 2 minutes to find out a player is left my game.

Node NPM unable to require package by name only path

I created a new Node Package to start sharing a project that I'm working on, but I'm having a bit of trouble getting my require statement to work.
Project: https://github.com/kcjonson/indigo
The issue that I'm having is that requiring my module this way:
var indigo = require('indigo');
Does not work, but requiring it by more explicit path like:
var indigo = require('indigo/lib/indigo');
works just fine.
I assume this is an issue with my package.json file which is as follows:
{
"author": {
"name": "Kevin Jonson",
"email": "kcjonson#gmail.com",
"url": "http://kevinjonson.com"
},
"name": "indigo",
"description": "Node.js Facade for Perceptive Home Automations Indigo home automation servers python REST API",
"version": "0.0.7",
"repository": {
"type": "git",
"url": "git://github.com/kcjonson/indigo.git" },
"directories": {
"lib": "./lib"
},
"main:": "lib/indigo.js",
"license": "MIT",
"private": false
}
I've successfully added it to NPM and running npm install on the project that is using it does download the correct latest version and places it in the node_modules directory as expected.
Any help would be appreciated, thanks in advance.
I am not sure if that is going to work but still worth a try I guess.
Try removing 'directories'