Creating a Angular2 TS app in a Cordova project - angularjs

I thought to myself, I should leverage the best of Angular, Angular 2 TS and cordova to get my web application up and running. Not a bad idea to think of, but I was having some minor issues. I wasn't sure if anyone had them, or knows how to implement them. I noticed there are next to no how-tos online and you end up when searching for angular 2 cordova you actually get results for a different mobile web framework.
So first thing I did was execute these scripts.
mkdir myApp
cd myApp
cordova create .
cordova platform add android browser
cordova plugin add cordova-plugin-browsersync
the browser sync i thought would be necessary to handle the fact I am no longer using server-lite in the angular2 application which has browser sync. More to come later.
cd www
rm /f /r * #or equivalent. I deleted the contents.
This is where I start the Angular 2 TS how-to via: https://angular.io/docs/ts/latest/quickstart.html
#create 4 files: package.json, systemjs.config.js, tsconfig.json, typings.json
Now this is where I do some modifications. Since we are using Cordova and Not server-light, i went into the package.json and updated the npm start script to: "start": "tsc && concurrently \"npm run tsc:w\" \"cordova run browser --live-reload\" ",. The reason as I stated is that it was server-lite but we are using cordova. Since cordova itself doesnt do a live refresh, I installed the plugin cordova-plugin-browsersync you can read up on it here: https://github.com/nparashuram/cordova-plugin-browsersync
npm install
npm typings install
mkdir app
#make ts files.
cd ..
#make html / css file.
Now, Everything is in place, i created everything for Angular 2 in [cordovaProj]/www and i want to now run it.
npm start
it will compile everything and run the cordova server. AWESOME. IT WORKS.... or so i thought. It doesn't refresh.
Test 1: Change index.html file.. Change the contents of title.
Result 1: No live update.
Test 2: Change the result of www/app/app.component.ts template to say: Hello World.
Result 2: tsc-w fires, updates everything as angular does. Browser doesnt refresh.
Observations: When I run npm start i noticed 1 thing, even though it is saying to run cordova run browser --live-reload it ends up running cordova run --nobuild
Here is the console output i scraped:
C:\Users\wfrancis\WebstormProjects\SampleCordovaAngular2Application\www\app>npm
start
> angular-quickstart#1.0.0 start C:\Users\wfrancis\WebstormProjects\SampleCordov
aAngular2Application\www
> tsc && concurrently "npm run tsc:w" "cordova run browser --live-reload"
[0]
[0] > angular-quickstart#1.0.0 tsc:w C:\Users\wfrancis\WebstormProjects\SampleCo
rdovaAngular2Application\www
[0] > tsc -w
[0]
[0] 9:38:35 AM - Compilation complete. Watching for file changes.
[1] Running command: cmd "/s /c "C:\Users\wfrancis\WebstormProjects\SampleCordov
aAngular2Application\platforms\browser\cordova\build.bat""
[1]
[1] Cleaning Browser project
[1] Running command: cmd "/s /c "C:\Users\wfrancis\WebstormProjects\SampleCordov
aAngular2Application\platforms\browser\cordova\run.bat --nobuild""
[1]
[1] Static file server running # http://localhost:8000/index.html
[1] CTRL + C to shut down
[1] 200 /index.html
[1] 200 /styles.css
[1] 200 /systemjs.config.js (gzip)
[1] 200 /node_modules/reflect-metadata/Reflect.js (gzip)
[1] 200 /node_modules/zone.js/dist/zone.js (gzip)
[1] 200 /node_modules/core-js/client/shim.min.js (gzip)
[1] 200 /node_modules/systemjs/dist/system.src.js (gzip)
[1] 200 /app/main.js
[1] 404 /favicon.ico
[1] 200 /node_modules/#angular/platform-browser-dynamic/bundles/platform-browser
-dynamic.umd.js (gzip)
[1] 200 /app/app.module.js (gzip)
[1] 200 /app/app.component.js (gzip)
[1] 200 /node_modules/#angular/core/bundles/core.umd.js (gzip)
[1] 200 /node_modules/#angular/platform-browser/bundles/platform-browser.umd.js
(gzip)
[1] 200 /node_modules/#angular/compiler/bundles/compiler.umd.js (gzip)
[1] 200 /node_modules/#angular/common/bundles/common.umd.js (gzip)
[1] 200 /node_modules/rxjs/Subject.js (gzip)
[1] 200 /node_modules/rxjs/Observable.js (gzip)
[1] 200 /node_modules/rxjs/Subscriber.js (gzip)
[1] 200 /node_modules/rxjs/util/ObjectUnsubscribedError.js
[1] 200 /node_modules/rxjs/Subscription.js (gzip)
[1] 200 /node_modules/rxjs/symbol/rxSubscriber.js
[1] 200 /node_modules/rxjs/SubjectSubscription.js (gzip)
[1] 200 /node_modules/rxjs/util/root.js
[1] 200 /node_modules/rxjs/util/toSubscriber.js
[1] 200 /node_modules/rxjs/symbol/observable.js
[1] 200 /node_modules/rxjs/util/isFunction.js
[1] 200 /node_modules/rxjs/Observer.js
[1] 200 /node_modules/rxjs/util/isArray.js
[1] 200 /node_modules/rxjs/util/isObject.js
[1] 200 /node_modules/rxjs/util/tryCatch.js
[1] 200 /node_modules/rxjs/util/errorObject.js
[1] 200 /node_modules/rxjs/util/UnsubscriptionError.js (gzip)
I noticed on the github for browsersync, it said to do: cordova run -- --live-reload but the first set of -- i thought meant to be whatever platform you were running, in my case browser
Test 3: Used: cordova run -- --live-reload instead of cordova run browser --live-reload, called npm start (printout below), and attempted to change HTML.
Result 3: No update.
Test 4: same as Test 3, but attempted to change www/app/app.component.ts and noticed that a change was watched, and the new JS was compiled. Still no update to application.
C:\Users\wfrancis\WebstormProjects\SampleCordovaAngular2Application\www\app>npm
start
> angular-quickstart#1.0.0 start C:\Users\wfrancis\WebstormProjects\SampleCordov
aAngular2Application\www
> tsc && concurrently "npm run tsc:w" "cordova run -- --live-reload"
[0]
[0] > angular-quickstart#1.0.0 tsc:w C:\Users\wfrancis\WebstormProjects\SampleCo
rdovaAngular2Application\www
[0] > tsc -w
[0]
[0] 9:56:33 AM - Compilation complete. Watching for file changes.
[1] Running command: cmd "/s /c "C:\Users\wfrancis\WebstormProjects\SampleCordov
aAngular2Application\platforms\browser\cordova\build.bat --live-reload""
[1]
[1] Cleaning Browser project
[1] [BS] Access URLs:
[1] -------------------------------------
[1] Local: http://localhost:3000
[1] External: http://10.224.60.17:3000
[1] -------------------------------------
[1] UI: http://localhost:3001
[1] UI External: http://10.224.60.17:3001
[1] -------------------------------------
[1] [BS] Serving files from: platforms\android\assets\www
[1] [BS] Serving files from: platforms\ios\www
[1] [BS] Watching files...
[1] ANDROID_HOME=C:\Users\wfrancis\AppData\Local\Android\sdk
[1] JAVA_HOME=C:\Program Files\Java\jdk1.8.0_77
[1] Starting a new Gradle Daemon for this build (subsequent builds will be faste
r).
[1] Incremental java compilation is an incubating feature.
[1] :preBuild UP-TO-DATE
[1] :preDebugBuild UP-TO-DATE
[1] :checkDebugManifest
[1] :CordovaLib:preBuild UP-TO-DATE
[1] :CordovaLib:preDebugBuild UP-TO-DATE
[1] :CordovaLib:compileDebugNdk UP-TO-DATE
[1] :CordovaLib:compileLint
[1]
[1] :CordovaLib:copyDebugLint UP-TO-DATE
[1] :CordovaLib:mergeDebugProguardFiles
[1]
[1] :CordovaLib:packageDebugRenderscript
[1] UP-TO-DATE
[1] :CordovaLib:checkDebugManifest
[1] :CordovaLib:prepareDebugDependencies
[1] :CordovaLib:compileDebugRenderscript
[1]
[1] :CordovaLib:generateDebugResValues
[1]
[1] :CordovaLib:generateDebugResources
[1] :CordovaLib:packageDebugResources
[1]
[1] :CordovaLib:compileDebugAidl
[1]
[1] :CordovaLib:generateDebugBuildConfig
[1]
[1] :CordovaLib:mergeDebugShaders
[1]
[1] :CordovaLib:compileDebugShaders
[1]
[1] :CordovaLib:generateDebugAssets
[1]
[1] :CordovaLib:mergeDebugAssets
[1]
[1] :CordovaLib:processDebugManifest
[1]
[1] :CordovaLib:processDebugResources
[1]
[1] :CordovaLib:generateDebugSources
[1] :CordovaLib:incrementalDebugJavaCompilationSafeguard
[1]
[1] :CordovaLib:compileDebugJavaWithJavac
[1]
[1] :CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs hav
e changed, no previous execution, etc.).
[1] Note: Some input files use or override a deprecated API.
[1] Note: Recompile with -Xlint:deprecation for details.
[1] :CordovaLib:processDebugJavaRes
[1] UP-TO-DATE
[1] :CordovaLib:transformResourcesWithMergeJavaResForDebug
[1]
[1] :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
[1]
[1] :CordovaLib:mergeDebugJniLibFolders
[1]
[1] :CordovaLib:transformNative_libsWithMergeJniLibsForDebug
[1]
[1] :CordovaLib:transformNative_libsWithSyncJniLibsForDebug
[1]
[1] :CordovaLib:bundleDebug
[1]
[1] :prepareAndroidCordovaLibUnspecifiedDebugLibrary
[1]
[1] :prepareDebugDependencies
[1] :compileDebugAidl
[1]
[1] :compileDebugRenderscript
[1]
[1] :generateDebugBuildConfig
[1]
[1] :mergeDebugShaders
[1]
[1] :compileDebugShaders
[1]
[1] :generateDebugAssets
[1] :mergeDebugAssets
[1] Running command: cmd "/s /c "C:\Users\wfrancis\WebstormProjects\SampleCordov
aAngular2Application\platforms\browser\cordova\run.bat --nobuild --live-reload""
[1]
[1] Static file server running # http://localhost:8000/index.html
[1] CTRL + C to shut down
[1] 200 /index.html
[1] 200 /styles.css
[1] 200 /systemjs.config.js (gzip)
[1] 200 /node_modules/zone.js/dist/zone.js (gzip)
[1] 200 /node_modules/reflect-metadata/Reflect.js (gzip)
[1] 200 /node_modules/core-js/client/shim.min.js (gzip)
[1] 200 /node_modules/systemjs/dist/system.src.js (gzip)
[1] 200 /app/main.js
[1] 200 /node_modules/#angular/platform-browser-dynamic/bundles/platform-browser
-dynamic.umd.js (gzip)
[1] 200 /app/app.module.js (gzip)
[1] 200 /app/app.component.js (gzip)
[1] 200 /node_modules/#angular/platform-browser/bundles/platform-browser.umd.js
(gzip)
[1] 200 /node_modules/#angular/core/bundles/core.umd.js (gzip)
[1] 200 /node_modules/#angular/common/bundles/common.umd.js (gzip)
[1] 200 /node_modules/#angular/compiler/bundles/compiler.umd.js (gzip)
[1] 200 /node_modules/rxjs/Subject.js (gzip)
[1] 200 /node_modules/rxjs/Observable.js (gzip)
[1] 200 /node_modules/rxjs/util/ObjectUnsubscribedError.js
[1] 200 /node_modules/rxjs/util/root.js
[1] 200 /node_modules/rxjs/symbol/rxSubscriber.js
[1] 200 /node_modules/rxjs/Subscriber.js (gzip)
[1] 200 /node_modules/rxjs/Subscription.js (gzip)
[1] 200 /node_modules/rxjs/SubjectSubscription.js (gzip)
[1] 200 /node_modules/rxjs/util/toSubscriber.js
[1] 200 /node_modules/rxjs/symbol/observable.js
[1] 200 /node_modules/rxjs/util/isFunction.js
[1] 200 /node_modules/rxjs/Observer.js
[1] 200 /node_modules/rxjs/util/isArray.js
[1] 200 /node_modules/rxjs/util/isObject.js
[1] 200 /node_modules/rxjs/util/tryCatch.js
[1] 200 /node_modules/rxjs/util/errorObject.js
[1] 200 /node_modules/rxjs/util/UnsubscriptionError.js (gzip)
Does anyone have a way in which I could get a Live Update for the Browser? This is a critical piece for development, and waiting a few minutes for it to run through npm start is too much.
EDIT I noticed a update that was very much so delayed. Result 4 gave me this printout:
[0] 10:03:47 AM - File change detected. Starting incremental compilation...
[0] 10:03:49 AM - Compilation complete. Watching for file changes.
[1] [BS] Reloading Browsers...
[1] [BS] Reloading Browsers...
[1]
[1] FAILURE: Build failed with an exception.
[1]
[1] * What went wrong:
[1] Execution failed for task ':mergeDebugAssets'.
[1] > Error: java.io.FileNotFoundException: C:\Users\wfrancis\WebstormProjects\S
ampleCordovaAngular2Application\platforms\android\assets\www\node_modules\lite-s
erver\node_modules\browser-sync\node_modules\bs-recipes\recipes\grunt.html.injec
tion\app\browser-sync-start.html (The system cannot find the file specified)
[1]
[1] * Try:
[1] Run with --stacktrace option to get the stack trace. Run with --info or --de
bug option to get more log output.
[1]
[1] Error: java.io.FileNotFoundException: C:\Users\wfrancis\WebstormProjects\Sam
pleCordovaAngular2Application\platforms\android\assets\www\node_modules\lite-ser
ver\node_modules\browser-sync\node_modules\bs-recipes\recipes\grunt.html.injecti
on\app\browser-sync-start.html (The system cannot find the file specified)
[1] :mergeDebugAssets FAILED
[1]
[1] BUILD FAILED
[1]
[1] Total time: 3 mins 12.839 secs
[1]
[1] * What went wrong:
[1] Execution failed for task ':mergeDebugAssets'.
[1] > Error: java.io.FileNotFoundException: C:\Users\wfrancis\WebstormProjects\S
ampleCordovaAngular2Application\platforms\android\assets\www\node_modules\lite-s
erver\node_modules\browser-sync\node_modules\bs-recipes\recipes\grunt.html.injec
tion\app\browser-sync-start.html (The system cannot find the file specified)
[1]
[1] * Try:
[1] Run with --stacktrace option to get the stack trace. Run with --info or --de
bug option to get more log output.
[1]

Related

Can't add DifferentialEquation.jl to Julia 1.7.0

I recently went from Julia 1.6.3 to 1.7.0. I copied the Manifest and the Project.toml files to the new environments folder and updated the Manifest file to the newer version according to instructions. Everything worked fine. However, when I later tried to add DifferentialEquations.jl I got this error:
(#v1.7) pkg> precompile
Precompiling project...
✗ DiffEqNoiseProcess
✗ DiffEqFinancial
✗ StochasticDiffEq
✗ MultiScaleArrays
✗ DifferentialEquations
0 dependencies successfully precompiled in 30 seconds (252 already precompiled)
ERROR: The following 2 direct dependencies failed to precompile:
DiffEqNoiseProcess [77a26b50-5914-5dd7-bc55-306e6241c503]
Failed to precompile DiffEqNoiseProcess [77a26b50-5914-5dd7-bc55-306e6241c503] to C:\Users\*user*\.julia\compiled\v1.7\DiffEqNoiseProcess\jl_F949.tmp.
WARNING: Method definition Type##kw(Any, Type{Base.MPFR.BigFloat}, Base.Irrational{:fourinvπ}) in module StatsFuns at irrationals.jl:182 overwritten in module IrrationalConstants on the same line (check for duplicate calls to `include`).
** incremental compilation may be fatally broken for this module **
WARNING: Method definition Type##kw(Any, Type{Base.MPFR.BigFloat}, Base.Irrational{:twoinvπ}) in module StatsFuns at irrationals.jl:182 overwritten in module IrrationalConstants on the same line (check for duplicate calls to `include`).
** incremental compilation may be fatally broken for this module **
...
It continues with similar warnings for a while and finally I get this:
ERROR: LoadError: UndefVarError: SciMLBase not defined
Stacktrace:
[1] top-level scope
# C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\solve.jl:1
[2] include(mod::Module, _path::String)
# Base .\Base.jl:418
[3] include(x::String)
# DiffEqNoiseProcess C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\DiffEqNoiseProcess.jl:1
[4] top-level scope
# C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\DiffEqNoiseProcess.jl:23
[5] include
# .\Base.jl:418 [inlined]
[6] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String},
dl_load_path::Vector{String}, load_path::Vector{String},
concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::String)
# Base .\loading.jl:1318
[7] top-level scope
# none:1
[8] eval
# .\boot.jl:373 [inlined]
[9] eval(x::Expr)
# Base.MainInclude .\client.jl:453
[10] top-level scope
# none:1
in expression starting at
C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\solve.jl:1
in expression starting at C:\Users\manfr\.julia\packages\DiffEqNoiseProcess\9NzQP\src\DiffEqNoiseProcess.jl:1
ERROR: LoadError: Failed to precompile DiffEqNoiseProcess [77a26b50-5914-5dd7-bc55-
306e6241c503] to C:\Users\manfr\.julia\compiled\v1.7\DiffEqNoiseProcess\jl_5956.tmp.
Stacktrace:
[1] error(s::String)
# Base .\error.jl:33
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO,
ignore_loaded_modules::Bool)
# Base .\loading.jl:1466
[3] compilecache(pkg::Base.PkgId, path::String)
# Base .\loading.jl:1410
[4] _require(pkg::Base.PkgId)
# Base .\loading.jl:1120
[5] require(uuidkey::Base.PkgId)
# Base .\loading.jl:1013
[6] require(into::Module, mod::Symbol)
# Base .\loading.jl:997
[7] include
# .\Base.jl:418 [inlined]
[8] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String},
dl_load_path::Vector{String}, load_path::Vector{String},
concrete_deps::Vector{Pair{Base.PkgId, UInt64}}, source::Nothing)
# Base .\loading.jl:1318
[9] top-level scope
# none:1
[10] eval
# .\boot.jl:373 [inlined]
[11] eval(x::Expr)
# Base.MainInclude .\client.jl:453
[12] top-level scope
# none:1
in expression starting at
C:\Users\manfr\.julia\packages\DifferentialEquations\el96s\src\DifferentialEquations.jl:1
I've tried to build, precompile, delete the package folder and add it again, but nothing seems to work. I also tried to add the package to my Julia 1.6.3 installation, and that works fine. Does anyone know what the problem could be?
Manifests are version specific (since package versions can be Julia version specific). Re-resolve your packages without the manifest.

JULIA 1.6.4 ERROR: Unable to automatically install 'OpenSpecFun'

I am trying to add the package "Distributions" (and others):
(#v1.6) pkg> add Distributions
And I get:
ERROR: Unable to automatically install 'OpenSpecFun' from 'C:\Users\cescalac\.julia\packages\OpenSpecFun_jll\1Zaof\Artifacts.toml'
Stacktrace:
[1] error(s::String)
# Base .\error.jl:33
[2] ensure_artifact_installed(name::String, meta::Dict{String, Any}, artifacts_toml::String; platform::Base.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool, io::Base.TTY)
# Pkg.Artifacts C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Artifacts.jl:445
[3] ensure_all_artifacts_installed(artifacts_toml::String; platform::Base.BinaryPlatforms.Platform, pkg_uuid::Nothing, include_lazy::Bool, verbose::Bool, quiet_download::Bool, io::Base.TTY)
# Pkg.Artifacts C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Artifacts.jl:510
[4] download_artifacts(ctx::Pkg.Types.Context, pkg_roots::Vector{String}; platform::Base.BinaryPlatforms.Platform, verbose::Bool, io::Base.TTY)
# Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:710
[5] download_artifacts(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; platform::Base.BinaryPlatforms.Platform, julia_version::VersionNumber, verbose::Bool, io::Base.TTY)
# Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:687
[6] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, new_git::Vector{Base.UUID}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform)
# Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1242
[7] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Iterators.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
# Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:204
[8] add(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
# Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:80
[9] add(pkgs::Vector{Pkg.Types.PackageSpec})
# Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:78
[10] #add#23
# C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:76 [inlined]
[11] add
# C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:76 [inlined]
[12] #add#22
# C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:75 [inlined]
[13] add(pkg::String)
# Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:75
[14] top-level scope
# REPL[1]:1
I uninstall everything, install again. The error persists. Thank you in advance if you can help me with the solution. Julia version 1.6.4.
With ENV["JULIA_DEBUG"]="all", I get
julia> Pkg.add("Distributions")
Resolving package versions...
Downloading artifact: OpenSpecFun
┌ Debug: download_artifact error
│ tree_hash = SHA1("3e683ec5ca945a5aca74c49e8cccdf37c19b84a3")
│ tarball_url = "https://pkg.julialang.org/artifact/3e683ec5ca945a5aca74c49e8cccdf37c19b84a3"
│ tarball_hash = nothing
│ err = HTTP/1.1 403 MediaTypeBlocked while requesting https://pkg.julialang.org/artifact/3e683ec5ca945a5aca74c49e8cccdf37c19b84a3
Downloaded artifact: OpenSpecFun
Downloading artifact: OpenSpecFun
┌ Debug: download_artifact error
│ tree_hash = SHA1("3e683ec5ca945a5aca74c49e8cccdf37c19b84a3")
│ tarball_url = "https://github.com/JuliaBinaryWrappers/OpenSpecFun_jll.jl/releases/download/OpenSpecFun-v0.5.5+0/OpenSpecFun.v0.5.5.x86_64-w64-mingw32-libgfortran5.tar.gz"
│ tarball_hash = "56018ef016338b838d407cd58ffb7033584dd78c31b9d1082cdae10556a902cd"
│ err = HTTP/1.1 403 MediaTypeBlocked while requesting https://github.com/JuliaBinaryWrappers/OpenSpecFun_jll.jl/releases/download/OpenSpecFun-v0.5.5+0/OpenSpecFun.v0.5.5.x86_64-w64-mingw32-libgfortran5.tar.gz
Downloaded artifact: OpenSpecFun
(pasting my comments as an answer since this seems likely to be the issue.)
The output of ENV["JULIA_DEBUG"]="all" (which makes Artifacts print more detailed errors) indicates that it's a problem with downloading the artifact file.
│ err = HTTP/1.1 403 MediaTypeBlocked while requesting https://github.com/JuliaBinaryWrappers/OpenSpecFun_jll.jl/releases/download/OpenSpecFun-v0.5.5+0/OpenSpecFun.v0.5.5.x86_64-w64-mingw32-libgfortran5.tar.gz
MediaTypeBlocked in this case (since the link works for the rest of us) indicates that this is likely a firewall/proxy in your network that's blocking these files from being downloaded. You'll likely encounter the same error with any attempt to access these files, for eg. from a browser or with wget.
Changing the network config to allow these files would be the best course of action (and disallowing tar.gz files seems overly restrictive anyway). In case you're not able to do that, you can download the file from a different network and copy it to the place the artifacts mechanism would have placed it in, which would also allow this package installation to continue.

Cannot use FITSIO in Julia

I just started using Julia and installed the FITSIO package. When loading it I get the following error
julia> using FITSIO
[ Info: Precompiling FITSIO [525bcba6-941b-5504-bd06-fd0dc1a4d2eb]
ERROR: LoadError: syntax: extra token "ImageHDU" after end of expression
Stacktrace:
[1] include at .\boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at .\loading.jl:1038
[3] include(::Module, ::String) at .\sysimg.jl:29
[4] top-level scope at none:2
[5] eval at .\boot.jl:319 [inlined]
[6] eval(::Expr) at .\client.jl:389
[7] top-level scope at .\none:3
in expression starting at C:\Users\romain\.julia\packages\FITSIO\WueGk\src\FITSIO.jl:54
ERROR: Failed to precompile FITSIO [525bcba6-941b-5504-bd06-fd0dc1a4d2eb] to C:\Users\romain\.julia\compiled\v1.0\FITSIO\mbga9.ji.
Stacktrace:
[1] error(::String) at .\error.jl:33
[2] macro expansion at .\logging.jl:313 [inlined]
[3] compilecache(::Base.PkgId, ::String) at .\loading.jl:1184
[4] macro expansion at .\logging.jl:311 [inlined]
[5] _require(::Base.PkgId) at .\loading.jl:941
[6] require(::Base.PkgId) at .\loading.jl:852
[7] macro expansion at .\logging.jl:311 [inlined]
[8] require(::Module, ::Symbol) at .\loading.jl:834
I tried to remove and add again the FITSIO package, but I always get the same error. The stacktrace seems to go to line 54 of FITSIO.jl So here is the content of this file from line 46 to 57
import .Libcfitsio: libcfitsio,
fits_assert_ok,
fits_assert_isascii,
TYPE_FROM_BITPIX
# HDU Types
#compat abstract type HDU end
type ImageHDU <: HDU
fitsfile::FITSFile
ext::Int
end
Do you know how to make this package work?
Thanks :)
Here is the answer from the FITSIO developers:
The latest stable version of this package isn't compatible with Julia
1.0. This has been already fixed in the development version, but we haven't tagged a new version since then.
Remove FITSIO.jl with
pkg> rm FITSIO
pkg> update
pkg> add FITSIO
pkg> dev FITSIO
After the rm, make sure you don't have any FITSIO.jl leftover, then
you can reinstall and switch to the development version within the
package manager, without installing another package
It appears that Julia automatically fetched the wrong package with
add FITSIO
I solved the problem by forcing the download URL to be
add https://github.com/JuliaAstro/FITSIO.jl

KNITRO.jl fails to load on Julia 1.0

Adding and building KNITRO.jl on 1.0 seems to work, but when running using I get an error.
(v1.0) pkg> add KNITRO
Resolving package versions...
Updating `~/.julia/environments/v1.0/Project.toml`
[no changes]
Updating `~/.julia/environments/v1.0/Manifest.toml`
[no changes]
(v1.0) pkg> build KNITRO
julia> using KNITRO
[ Info: Precompiling KNITRO [67920dd8-b58e-52a8-8622-53c4cffbe346]
ERROR: LoadError: syntax: extra token "KnitroProblem" after end of expression
Stacktrace:
[1] include at ./boot.jl:317 [inlined]
[2] include_relative(::Module, ::String) at ./loading.jl:1038
[3] include(::Module, ::String) at ./sysimg.jl:29
[4] top-level scope at none:2
[5] eval at ./boot.jl:319 [inlined]
[6] eval(::Expr) at ./client.jl:389
[7] top-level scope at ./none:3
in expression starting at
/home/svcarpacomp/.julia/packages/KNITRO/Zou9S/src/KNITRO.jl:37
ERROR: Failed to precompile KNITRO [67920dd8-b58e-52a8-8622-53c4cffbe346] to /home/svcarpacomp/.julia/compiled/v1.0/KNITRO/9GHjY.ji.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] macro expansion at ./logging.jl:313 [inlined]
[3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1184
[4] _require(::Base.PkgId) at ./logging.jl:311
[5] require(::Base.PkgId) at ./loading.jl:852
[6] macro expansion at ./logging.jl:311 [inlined]
[7] require(::Module, ::Symbol) at ./loading.jl:834
Assuming you're grabbing the copy on github and reading your error message, it fails at line 37 of KNITRO.jl:
type KnitroProblem
type is deprecated. It is [mutable] struct.
The current version is for v0.6 apparently. If you try with v0.7 it should toss several deprecation warnings.

gulp css:watch exited with code null

I installed this library:
npm install --save-dev css-loader
https://github.com/webpack-contrib/css-loader
now, when I want to run my project I got this errors:
yarn start
yarn run v1.5.1
$ cross-env NODE_PATH=./app concurrently --kill-others "node app/server" "gulp css:watch"
[1] [10:00:19]
[1] Using gulpfile ~/Desktop/react js/shadyab/gulpfile.js
[1] [10:00:19] Starting 'css'...
[1] [10:00:19]
[1] Finished 'css' after 320 ms
[1] [10:00:19] Starting 'css:watch'...
[1] [10:00:19]
[1] Finished 'css:watch' after 9.38 ms
[0] Server is listening to port: 3000
[0] events.js:183
[0] throw er; // Unhandled 'error' event
[0] ^
[0]
[0] Error: listen EADDRINUSE :::3000
[0] at Object._errnoException (util.js:1022:11)
[0] at _exceptionWithHostPort (util.js:1044:20)
[0] at Server.setupListenHandle [as _listen2] (net.js:1367:14)
[0] at listenInCluster (net.js:1408:12)
[0] at Server.listen (net.js:1492:7)
[0] at Function.listen (/Users/sm_emamian/Desktop/react js/shadyab/node_modules/express/lib/application.js:618:24)
[0] at Object.<anonymous> (/Users/sm_emamian/Desktop/react js/shadyab/app/server/server.js:73:8)
[0] at Module._compile (module.js:652:30)
[0] at loader (/Users/sm_emamian/Desktop/react js/shadyab/node_modules/babel-register/lib/node.js:144:5)
[0] at Object.require.extensions.(anonymous function) [as .js] (/Users/sm_emamian/Desktop/react js/shadyab/node_modules/babel-register/lib/node.js:154:7)
[0] node app/server exited with code 1
--> Sending SIGTERM to other processes..
[1] gulp css:watch exited with code null
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c cross-env NODE_PATH=./app concurrently --kill-others \"node app/server\" \"gulp css:watch\"
Directory: /Users/sm_emamian/Desktop/react js/shadyab
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/sm_emamian/Desktop/react js/shadyab/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Resources