Grunt plugin grunt-exec v2.0.0 doesn't execute a simple command while v1.0.1 does - gruntjs

I was using grunt-exec v1.0.1 with this configuration in Gruntfile.js:
grunt.initConfig({
exec: {
tsc: {
cmd: "tsc"
}
},
...
}
...
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask('debug', [
...
'exec:tsc',
...
]);
Then running grunt debug in console tsc is executed correctly.
In another project with similar configuration it's installed the last version of
grunt-exec(v.2.0.0) and running grunt-debug the next error is returned:
Running "exec:tsc" (exec) task
>> Failed with: Error: spawn tsc ENOENT
Warning: Task "exec:tsc" failed. Use --force to continue.
With -verbose option it returns:
Running "exec:tsc" (exec) task
Verifying property exec.tsc exists in config...OK
File: [no files]
tsc
buffer : disabled
timeout : infinite
killSig : SIGTERM
shell : true
command : tsc
args : []
stdio : [ignore,pipe,pipe]
cwd : D:\Pruebas\Angular 2\ATemplate
exitcodes: 0
pid : undefined
>> Failed with: Error: spawn tsc ENOENT
Warning: Task "exec:tsc" failed. Use --force to continue.
I know I can have it working using v1.0.1 of grunt-exec but I want to know how must I do it with v2.0.0. The project documentation in github has not given me a clue.

Looks like the grunt-exec version v2.0.0 uses some ECMAScript features that are not supported in older versions of node.
The first one i saw was:
Symbol.match, String.prototype.endsWith that is not supported in node < v6.10.2
See here: http://node.green/
Upgrade your node version to fix this issue.

Related

dyld: Symbol not found: _SecTrustEvaluateWithError

I'm on MacPro OS 10.12 (can not be upgraded to 10.13 or beyond bc HW is old!) and I get below error.
Any help please
Thanks
Task start deno run -A --watch=static/,routes/ dev.ts
Watcher Process started.
The manifest has been generated for 3 routes and 1 islands.
Server listening on http://localhost:3000
dyld: Symbol not found: _SecTrustEvaluateWithError
Referenced from: /Users/kemalgencay/Library/Caches/esbuild/bin/esbuild-darwin-
64#0.14.39
Expected in: flat namespace
An error occured during route handling or page rendering. Error: The service was
stopped
at https://deno.land/x/esbuild#v0.14.39/mod.js:1304:25
at https://deno.land/x/esbuild#v0.14.39/mod.js:633:9
at afterClose (https://deno.land/x/esbuild#v0.14.39/mod.js:611:7)
at https://deno.land/x/esbuild#v0.14.39/mod.js:1844:11
error: Uncaught (in promise) BrokenPipe: Broken pipe (os error 32)
Watcher Process finished. Restarting on file change...
"devDependencies": {
"esbuild-wasm":"latest"
},
"overrides": {
"esbuild":"npm:esbuild-wasm#latest"
}
Just add this to the package.json
And then run: npm install
Hope it helps!

Problem with yarn dependency using the rhino R package

I am trying the new R package rhino from the Appsilon team to build shiny apps.
Running on a Windows10 laptop I installed the dependencies node.js and yarn as described in this tutorial.
Here is the output of rhino::diagnostics() :
Windows 10 x64 build 19042
R version 4.1.0 (2021-05-18)
rhino: 1.0.0
node: v16.15.0
yarn: 1.22.15
Running rhino::build_sass() gives me this error:
yarn run v1.22.15
$ sass --no-source-map --style=compressed root/app/styles/main.scss:root/app/static/css/app.min.css
Error reading root\app\styles\main.scss: no such file or directory.
error Command failed with exit code 66.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error:
! System command 'yarn' exited with status 66.
i If you can't use Node.js and yarn, try using sass: 'r' configuration.
Run `rlang::last_error()` to see where the error occurred.
I am puzzled by the paths in the call to "sass" that start with "root/app". My app is located in my home directory:
"C:/Users/XXX/Documents/workspace/rhino_dummy"
Is it possible that these paths are wrong in the call?
Luckily, the suggested alternative with the deprecated libsass interpreter works for the sass example in the tutorial. It would be nice to have node.js with sass working on Windows10 for future more complex apps.
Edit 1, after Kat's comment
Thanks Kat for the quick feedback. I added sass via yarn add sass and tried again same error:
> rhino::build_sass()
yarn run v1.22.15
warning ..\..\package.json: No license field
$ sass --no-source-map --style=compressed root/app/styles/main.scss:root/app/static/css/app.min.css
Error reading root\app\styles\main.scss: no such file or directory.
error Command failed with exit code 66.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error:
! System command 'yarn' exited with status 66.
i If you can't use Node.js and yarn, try using sass: 'r' configuration.
Run `rlang::last_error()` to see where the error occurred.
The warning is coming from the pckage.json file that was created by calling yarn inside my R project folder. It has only minimal content:
# package.json
{
"dependencies": {
"sass": "^1.51.0"
}
}
Out of curiosity, I tried to compile the javascript example, also failed with very similar error regarding folder paths:
> rhino::build_js()
yarn run v1.22.15
warning ..\..\package.json: No license field
$ webpack
assets by status 0 bytes [cached] 1 asset
ERROR in main
Module not found: Error: Can't resolve 'C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js' in 'C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node'
resolve 'C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js' in 'C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node'
using description file: C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration using description file: C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\package.json (relative path: ./root/app/js/index.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js.wasm doesn't exist
as directory
C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root\app\js\index.js doesn't exist
webpack 5.69.0 compiled with 1 error in 162 ms
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error in `system_yarn()`:
! System command 'yarn' exited with status 1.
Run `rlang::last_error()` to see where the error occurred.
For Node.js functions to work on Windows 10, you'll need to enable Developer Mode on your system as mentioned in our How-to: Use Rhino on Windows article. This is necessary for symbolic links to work on Windows (and the .rhino/node/root file is a symbolic link to the root of the project).
After you do that, delete the .rhino/node directory from your project, or run rhino:::add_node(clean = TRUE) in the root of your project.
Workaround
This answer is only a workaround, if you cannot enable developer mode on windows (see Kamil Zyla's post for more information).
It looks like the folder name "root" in the error messages is a broken variable.
The folder ...\workspace\rhino_dummy\.rhino\node\root does not exist, but the substructures do exit:
app\styles\main.scss
app\js\index.js
...\workspace\rhino_dummy\.rhino\node
Fix step1
I tried my luck and created the folder "root": C:\Users\XXX\Documents\workspace\rhino_dummy\.rhino\node\root
copied rhino_dummy\app\styles\main.scss to rhino_dummy\.rhino\node\root\app\styles\main.scss
copied rhino_dummy\app\js\index.js to rhino_dummy\.rhino\node\root\app\js\index.js
running rhino::build_sass() and rhino::build_js() now worked!
rhino::build_sass()
yarn run v1.22.15
warning ..\..\package.json: No license field
$ sass --no-source-map --style=compressed root/app/styles/main.scss:root/app/static/css/app.min.css
Done in 0.45s.
rhino::build_js()
yarn run v1.22.15
warning ..\..\package.json: No license field
$ webpack
asset app.min.js 470 bytes [compared for emit] [minimized] (name: main)
runtime modules 670 bytes 3 modules
./root/app/js/index.js 113 bytes [built] [code generated]
webpack 5.69.0 compiled successfully in 846 ms
Done in 2.58s.
Fix step2
copy results back to "static" folder, where they are expected by shiny/rhino
copy rhino_dummy\.rhino\node\root\app\static\css\app.min.css to rhino_dummy\app\static\css\app.min.css
copy \rhino_dummy\.rhino\node\root\app\static\js\app.min.js to \rhino_dummy\app\static\js\app.min.js
launch the app via shiny::shinyAppDir(".")
click the button from the tutorial ;-)
Edit1
Checking the github repo of rhino
SASS
definition of build_sass()
calling yarn("build-sass")
definition of build-sass
showing hard-coded root/app/styles/main.scss
JS
definition of build_js()
calling yarn("build-js")
definition of "webpack" build-js also showing hard-coded "root" in file paths

Can't run encore dev

Why i have this erros when I want to use yarn run encore dev ? When I want to add sass i get warning " > sass-loader#6.0.7" has unmet peer dependency "webpack#^2.0.0 || ^3.0.0 || ^4.0.0". But why ? Symfony 4. I cant install from github this modules npm install --save child_process fork-ts-checker-webpack-plugin fs module net readline spdx-exceptions spdx-license-ids spdx-license-ids/deprecated
yarn run encore dev
yarn run v1.5.1
$ c:\xampp\htdocs\dashboard\Symfony\pppp\node_modules.bin\encore dev
Running webpack ...
ERROR Failed to compile with 50 errors 09:48:38
These dependencies were not found:
child_process in ./node_modules/execa/index.js, ./node_modules/execa/node_modules/cross-spawn/index.js and 1 other
fork-ts-checker-webpack-plugin in ./node_modules/#symfony/webpack-encore/lib/plugins/forked-ts-types.js
fs in ./node_modules/#symfony/webpack-encore/lib/WebpackConfig.js, ./node_modules/#symfony/webpack-encore/lib/config/parse-runtime.js and 35 others
module in (webpack)/lib/NormalModule.js, (webpack)/lib/node/NodeTargetPlugin.js
net in ./node_modules/growly/lib/gntp.js, ./node_modules/node-notifier/lib/checkGrowl.js
readline in ./node_modules/friendly-errors-webpack-plugin/src/output.js
spdx-exceptions in ./node_modules/spdx-expression-parse/scan.js
spdx-license-ids in ./node_modules/spdx-correct/index.js, ./node_modules/spdx-expression-parse/scan.js
spdx-license-ids/deprecated in ./node_modules/spdx-expression-parse/scan.js
To install them, you can run: npm install --save child_process fork-ts-checker-webpack-plugin fs module net readline spdx-exceptions spdx-license-ids spdx-license-ids/deprecated
error An unexpected error occurred: "Command failed.
Exit code: 2
Command: C:\WINDOWS\system32\cmd.exe
Arguments: /d /s /c c:\xampp\htdocs\dashboard\Symfony\pppp\
ode_modules\.bin\encore dev
Directory: c:\xampp\htdocs\dashboard\Symfony\pppp
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "c:\xampp\htdocs\dashboard\Symfony\swisscar\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I suspect you have solved this issue by now but if not the solution to the problem lie in reading the error message. For starters the 'yarn run encore dev' is complaining that some dependencies required by some of the libraries your application depend on, are missing from your installation of node.

Error to build a signed apk

i'm trying to build an signed apk with visual studio /Cordova template. But i'm receiving this error: ERROR building one of the platforms 1
And : Error MDAVSCLI 1
I´m following this tutorial:
http://taco.visualstudio.com/en-us/docs/tutorial-package-publish-readme/
and my Keystore is like image bellow:
-package-resources:
[aapt] Creating full resource package...
-package:
[apkbuilder] Current build type is different than previous build: forced apkbuilder run.
[apkbuilder] Creating MainActivity-release-unsigned.apk for release...
-post-package:
-release-prompt-for-password:
-release-nosign:
-release-sign:
[echo] Signing final apk...
BUILD FAILED
C:\Users\Leo\AppData\Local\Android\sdk1\tools\ant\build.xml:1135: The following error occurred while executing this line:
C:\Users\Leo\AppData\Local\Android\sdk1\tools\ant\build.xml:1147: C:\Users\Leo\Desktop\Mobile\Mobile\platforms\android\"my-release-key.Keystore" (The file name syntax, the name of the directory or volume label incorrect)
Total time: 52 seconds
Picked up _JAVA_OPTIONS: -Xmx512M
C:\Users\Leo\Desktop\Mobile\Mobile\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "ant release -f C:\Users\Leo\Desktop\Mobile\Mobile\platforms\android\build.xml -Dout.dir=ant-build -Dgen.absolute.dir=ant-gen"
Command finished with error code 1: C:\Users\Leo\Desktop\Mobile\Mobile\platforms\android\cordova\build.bat --release
ERROR building one of the platforms : error : C:\Users\Leo\Desktop\Mobile\Mobile\platforms\android\cordova\build.bat: Command failed with exit code 1
You may not have the required environment or OS to build this project
MDAVSCLI : error : C:\Users\Leo\Desktop\Mobile\Mooobile\platforms\android\c
I've found a way : removing the quotes in my ant.properties i can build.

Grunt-karma aborted due to warnings

I'm getting "Aborted due to warnings" error when running grunt in --verbose mode.
ar#Woody:~/www/mysite-frontend-dev$ grunt build:debug
...
Registering "grunt-karma" local Npm module tasks.
Reading /home/ar/www/mysite-frontend-dev/node_modules/grunt-karma/package.json...OK
Parsing /home/ar/www/mysite-frontend-dev/node_modules/grunt-karma/package.json...OK Use --force to continue.
Aborted due to warnings.
Is there a way to get more detailed output? This warning message doesn't say much...
In general you can pass a command-line flag like $ grunt build:debug --verbose or $ grunt build:debug --stack to see more details
There was an issue with grunt-concurrent and Debian "squeeze". Updating to the latest (0.4.1) grunt-concurrent resolved the problem.

Resources