Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Install from local not working #368

Closed
BenWiseman opened this issue Sep 30, 2020 · 6 comments · Fixed by #427
Closed

Install from local not working #368

BenWiseman opened this issue Sep 30, 2020 · 6 comments · Fixed by #427
Assignees
Labels
bug Something isn't working

Comments

@BenWiseman
Copy link

Finshed: Installing your Shiny package into electricShine framework Error in system.file("extdata", "icon", package = my_package_name, lib.loc = library_path) : 'package' must be of length 1

I could just be not understanding the documentation, but it seems like local install isn't passing through the package path from local_package_path or something.

@BenWiseman
Copy link
Author

Here is where it breaks:

`
my_package_name <- electricShine::install_user_app(library_path = library_path ,
repo_location = "local",
repo = local_package_path,
repos = cran_like_url,
package_install_opts = package_install_opts)
}

Transfer icons if present -----------------------------------------------

electron_build_resources <- system.file("extdata",
"icon",
package = my_package_name,
lib.loc = library_path)`

Because electricShine::install_user_app can only return a NULL as it just gives the result of readLines() on a newly created tempfile?

I'm happy to help make this thing a reality, but, the code in install_user_app is really confusing. Like, are all of the environment variables just being used to prevent you from having to pass variables between functions?

@marecabo
Copy link

I am probably encountering the same issue when executing this on a fresh R 4.0.3 x64 install.

install.packages("remotes")
remotes::install_github("chasemc/electricShine")

buildPath <- paste(getwd(), "build", sep="/")

electricShine::electrify(
    app_name = "My_App",
    short_description = "My demo application",
    semantic_version = "1.0.0",
    build_path = buildPath,
    mran_date = NULL,
    cran_like_url = "https://cran.r-project.org",
    function_name = "run_app",
    git_host = NULL,
    git_repo = NULL,
    local_package_path = getwd(),
    package_install_opts = list(type = "binary"),
    run_build = TRUE
)

in the cloned https://github.com/chasemc/demoApp folder.

Install R into electricShine app folder: C:/***/demoApp/build/My_App/app/r_lang? (y/n)..y
If not found, can electricShine try and install nodejs to: C:/***/demoApp/renv/library/R-4.0/x86_64-w64-mingw32/electricShine/nodejs? (y/n)... y
versuche URL 'https://cran.r-project.org/bin/windows/base/R-4.0.3-win.exe'
Content type 'application/x-msdos-program' length 88237960 bytes (84.2 MB)
downloaded 84.2 MB

[...]

Trimmed 38563273bytes
Installing your Shiny package into electricShine framework.

Skipping 1 packages ahead of CRAN: rlang
v  checking for file 'C:\Users\***\AppData\Local\Temp\RtmpcDkto1\file4b9829f8596b\demoApp/DESCRIPTION'
-  preparing 'demoApp': (1m 55.7s)
v  checking DESCRIPTION meta-information ... 
-  checking for LF line-endings in source and make files and shell scripts (21.1s)
-  checking for empty or unneeded directories (609ms)
   Removed empty directory 'demoApp/build/My_App/app/r_lang/Tcl/bin64/lib/Tktable2.10/html'
   Removed empty directory 'demoApp/build/My_App/app/r_lang/Tcl/lib/Tktable2.10/html'
     NB: this package now depends on R (>= 3.5.0)
     WARNING: Added dependency on R >= 3.5.0 because serialized objects in  serialize/load version 3 cannot be read in older versions of R.  File(s) containing such objects:  'demoApp/build/My_App/app/r_lang/doc/CHANGES.rds' 

[...]

-  building 'demoApp_1.0.19.tar.gz'

* installing *source* package 'demoApp' ...
** using staged installation
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
Error: package or namespace load failed for 'shiny' in library.dynam(lib, package, package.lib):
 DLL 'rlang' not found: maybe not installed for this architecture?
Error : package 'shiny' could not be loaded
Fehler: Laden fehlgeschlagen
Ausführung angehalten
*** arch - x64
ERROR: loading failed for 'i386'
* removing 'C:/***/demoApp/build/My_App/app/r_lang/library/demoApp'
Fehler: Failed to install 'demoApp' from local:
  (konvertiert von Warnung) installation of package 'C:/Users/***/AppData/Local/Temp/RtmpcDkto1/file4b98556a3ed3/demoApp_1.0.19.tar.gz' had non-zero exit status
Ausführung angehalten
Finshed: Installing your Shiny package into electricShine framework
Fehler in system.file("extdata", "icon", package = my_package_name, lib.loc = library_path) : 
  'package' must be of length 1
Zusätzlich: Warnmeldungen:
1: In base::dir.create(install_r_to_path) :
  'C:\***\demoApp\build\My_App\app' existiert bereits
2: In dir.create(new_path) :
  'C:\Users\***\AppData\Local\Temp\RtmpMrEXtI\electricShine' existiert bereits
3: In dir.create(new_path) :
  'C:\Users\***\AppData\Local\Temp\RtmpMrEXtI\electricShine\templib' existiert bereits

Installing the package rlang did not help, as I guessed, because it was mentioned in the log.

@davidbudzynski
Copy link

I am having the very same issue as described by @BenWiseman

@marecabo
Copy link

I solved this issue for me with properly installing rlang from source in my base R installation (outside the renv) environment. RTools was also in my path.

After also specifying a custom nodejs_path as argument (see

nodejs_path = file.path(system.file(package = "electricShine"), "nodejs"),
maybe related: #308), it ran further and I encountered #343 for which a not-yet-merged fix exists.

With that, the demo app starts but loads indefinitely (see #343 (comment) and following) and this error message appears:

A JavaScript Error occurred in the main process

Uncaught exception:
Error: read ECONNRESET
    at TCP.onStreamRead (internal/stream_base_commons.js:200:27)

@Wladimir-Sanyer
Copy link

any solution? the problem persists and does not allow the application to be carried out normally

@chasemc
Copy link
Owner

chasemc commented Dec 8, 2020

I'm planning to work on the package in the next couple weeks. My assumption is that @marecabo is correct. Using electricShine from renv is likely to cause issues

@chasemc chasemc self-assigned this Dec 8, 2020
@chasemc chasemc added the bug Something isn't working label Dec 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants