compass:dist & execFile("compass.bat", ...) - Warning: spawn EPERM - ruby

First of all, I am pretty new to (modern) web development and I tried to import an existing project into my WebStorm and run a Grunt task.
It stops at "compass:dist" with:
$ node.exe C:\Users\lgr\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt --gruntfile C:\Users\lgr\workspace\js\rit-workshop\ui\Gruntfile.js buildall
Initializing
Command-line options: --gruntfile=C:\Users\lgr\workspace\js\rit-workshop\ui\Gruntfile.js, --verbose
Reading "Gruntfile.js" Gruntfile...OK
Registering Gruntfile tasks.
Registering "grunt-bump" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-bump\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-bump\package.json...OK
Loading "bump.js" tasks...OK
+ bump, bump-commit, bump-only
Registering "grunt-html2js" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-html2js\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-html2js\package.json...OK
Loading "html2js.js" tasks...OK
+ html2js
Registering "grunt-contrib-clean" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-clean\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-clean\package.json...OK
Loading "clean.js" tasks...OK
+ clean
Registering "grunt-contrib-copy" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-copy\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-copy\package.json...OK
Loading "copy.js" tasks...OK
+ copy
Registering "grunt-contrib-concat" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-concat\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-concat\package.json...OK
Loading "concat.js" tasks...OK
+ concat
Registering "grunt-contrib-cssmin" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-cssmin\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-cssmin\package.json...OK
Loading "cssmin.js" tasks...OK
+ cssmin
Registering "grunt-contrib-watch" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-watch\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-watch\package.json...OK
Loading "watch.js" tasks...OK
+ watch
Registering "grunt-contrib-jshint" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-jshint\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-jshint\package.json...OK
Loading "jshint.js" tasks...OK
+ jshint
Registering "grunt-contrib-uglify" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-uglify\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-uglify\package.json...OK
Loading "uglify.js" tasks...OK
+ uglify
Registering "grunt-karma" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-karma\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-karma\package.json...OK
Loading "grunt-karma.js" tasks...OK
+ karma
Registering "grunt-conventional-changelog" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-conventional-changelog\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-conventional-changelog\package.json...OK
Loading "changelog.js" tasks...OK
+ changelog
Registering "grunt-ngdocs" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-ngdocs\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-ngdocs\package.json...OK
Loading "grunt-ngdocs.js" tasks...OK
+ ngdocs
Registering "grunt-contrib-compass" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-compass\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-compass\package.json...OK
Loading "compass.js" tasks...OK
+ compass
Registering "grunt-contrib-requirejs" local Npm module tasks.
Reading C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-requirejs\package.json...OK
Parsing C:\Users\lgr\workspace\js\rit-workshop\ui\node_modules\grunt-contrib-requirejs\package.json...OK
Loading "requirejs.js" tasks...OK
+ requirejs
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK
Loading "Gruntfile.js" tasks...OK
- watch
+ BuildCommit, after-test, archive, archiveNONmin, buildall, buildjs, buildjsCommit, buildjsNONmin, buildjsNONminCommit, css, cssmy, default, delta, incrementBuild, shell, templates, test, watch
Running tasks: buildall
Running "buildall" task
Running "clean:buildall" (clean) task
Verifying property clean.buildall exists in config...OK
Files: [no src]
Options: force=false, no-write=false
>> 0 paths cleaned.
Running "css" task
Running "compass" task
Running "compass:dist" (compass) task
Verifying property compass.dist exists in config...OK
File: [no files]
Options: config="config.rb"
Warning: spawn EPERM Use --force to continue.
Aborted due to warnings.
I tried googling a bit, but all I seem to get is that this is a permission error, but I don't know where to start to fix it.
I tried cleaning the project, reinstalling Ruby for Windows, reinstalling compass inside of ruby. Nothing worked.
Update:
I tried debugging the build and in file bin-version\index.js the line
execFile(bin, ['--version'], function (err, stdout, stderr) {
seems to throw the error as the debugger wouldn't go beyond this point. The bin is compass.bat and it looks like the build has some permission error? When I open my cmd and type "compass --version" it just works fine. I have the ruby/bin in my classpath aswell where the compass.bat is placed.
Running "compass:dist" (compass) task
Verifying property compass.dist exists in config...OK
File: [no files]
Options: config="config.rb"
Warning: spawn EPERM Use --force to continue.
Does anyone know about what could cause this error?

I solved this, but I can't tell exactly what caused it. What I can say is that it has nothing to do with compass itself, wrong permissions or Windows - it has to do with a wrong project setup. So, if you get this error, check your setup and if every dependency is available.

Related

Getting error while bootstrapping opensearch dashboard

I am setting up opensearch dashboard in my windows PC and following below guide -
https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md
While bootstrapping, I am getting below error -
PS D:\opensearch\OpenSearch-Dashboards> yarn osd bootstrap
yarn run v1.22.18
$ node scripts/osd bootstrap
info [opensearch-dashboards] running yarn
$ node ./preinstall_check
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "typescript#4.0.2" is incompatible with requested version "typescript#~4.5.2"
success Already up-to-date.
succ yarn.lock analysis completed without any issues
succ 10 bootstrap builds are cached
info [#osd/i18n] running [osd:bootstrap] script
info [#osd/monaco] running [osd:bootstrap] script
info [#osd/opensearch-archiver] running [osd:bootstrap] script
info [#osd/opensearch] running [osd:bootstrap] script
ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: C:\Users\st\AppData\Roaming\nvm\v14.18.2\node_modules\yarn\bin\yarn.js run osd:bootstrap
'rm' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.
$ rm -rf target && tsc
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
at makeError (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:25150:11)
at handlePromise (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:24085:26)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:9051:9
at async scheduleItem (D:\opensearch\OpenSearch-Dashboards\packages\osd-pm\dist\index.js:10938:9)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
what I see here is, rm command is not recognized in windows and which is correct.
So how to fix this ?

Deploying KotlinJs React web app to Heroku, error extracting tar content of undefined failed

I have the following setup. Kotlin Multiplatform project with a Web App and Shared module. I also have included a build of a library that I had to modify myself as it wasn't working properly.
When trying to deploy to Heroku with these steps I get the following error
> Task :common:root:jsPackageJson
> Task :web-app:packageJson
> Task :web-app:testPackageJson
> Task :rootPackageJson
> Task :kotlinNpmInstall
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > sockjs > uuid#3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning workspace-aggregator-7524aa80-df12-48c3-95c5-de7144004dc0 > firebase-kotlin-sdk-firebase-app > webpack-dev-server > url > querystring#0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/LICENSE'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall
error https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/app/.cache/yarn/v6/npm-caniuse-lite-1.0.30001269-3a71bee03df627364418f9fd31adfc7aa1cc2d56-integrity/node_modules/caniuse-lite/data/features/getcomputedstyle.js'"
> Task :firebase-kotlin-sdk:kotlinNpmInstall FAILED
> Task :kotlinNpmInstall FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':firebase-kotlin-sdk:kotlinNpmInstall'.
> Process 'Resolving NPM dependencies using yarn' returns 1
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 5m 20s
18 actionable tasks: 18 executed
! ERROR: Failed to run Gradle!
We're sorry this build is failing. If you can't find the issue in application
code, please submit a ticket so we can help: https://help.heroku.com
You can also try reverting to the previous version of the buildpack by running:
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-gradle#previous-version
Thanks,
Heroku
! Push rejected, failed to compile Gradle app.
! Push failed
Tried running kotlinNpmInstall locally on both the library and the whole project and it works properly, with no failures.
While I do not know the exact cause, it seems that multiple yarn process are spawned that corrupt each other's packages.
This can be solved with the mutex option.
To add yarn options to a kotlin/js project you can add a .yarnrc file to the root of your project.
My .yarnrc's content:
--install.mutex network
This makes yarn use a predefined port on the network for its mutex.

Cannot run in production mode

I have a donejs application and its running ok in development mode donejs develop, but when I run it in production mode:
donejs build
donejs deploy (to firebase)
NODE_ENV=production donejs start
it will not start and show an error (see CODE A)
This file: file:my-app/dist/bundles/my-app/index.js:704 corresponds to JQuery 3.x and its not a dependency of the project itself but a dependency of can-connect-feathers (https://github.com/canjs/can-connect-feathers). In fact in index.js there is also included JQuery 2.x what makes me think there might be some sort of incompatibility among them.
I already tried changing the project's dependency to JQuery 3.x but didn't help. Actually it will make even donejs develop fail (see CODE B).
I also tried the following:
cd my-app/node_modules/steal
npm install
but didn't help, another error appears and finally tried cd my-app/node_modules/can && npm install but that end up in multiple errors.
I'm using:
donejs#0.9.2
node#4.6.2
npm#2.15.11
can-connect-feathers#1.2.1
CODE A
NODE_ENV=production donejs start
my-app#0.0.0 start my-app
done-serve --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [5] TypeError: Error loading "package.json!npm" at file:my-app/package.json
Error loading "bundles/my-app/index" at file:my-app/dist/bundles/my-app/index.js
Error evaluating file:my-app/dist/bundles/my-app/index.js
Cannot read property 'createElement' of undefined
at i (file:my-app/dist/bundles/my-app/index.js:704:20)
at file:my-app/dist/bundles/my-app/index.js:1039:2881
at file:my-app/dist/bundles/my-app/index.js:1039:3580
at file:my-app/dist/bundles/my-app/index.js:268:21
at file:my-app/dist/bundles/my-app/index.js:268:27
at Object.exports.runInThisContext (vm.js:54:17)
at doEval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:2059:10)
at __eval (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1976:7)
at Loader.exec [as __exec] (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:339:5)
at Loader.loader.instantiate (my-app/node_modules/steal/node_modules/steal-systemjs/dist/system.src.js:1517:16)
CODE B
donejs develop
my-app#0.0.0 develop my-app
done-serve --develop --proxy http://localhost:3030 --port 8080
done-serve starting on http://localhost:8080
Potentially unhandled rejection [8] Error: Error loading "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at <unknown>
Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "done-autorender#0.8.0#autorender" at file:my-app/node_modules/done-autorender/src/autorender.js
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
Potentially unhandled rejection [16] Error: Error loading "can#2.3.27#util/jquery/jquery" at file:my-app/node_modules/can/util/jquery/jquery.js
Error loading "can#2.3.27#util/jquery/jquery" from "my-app#0.0.0#index.stache!done-autorender#0.8.0#autorender" at file:my-app/src/index.stache
Did not find ./node_modules/can/node_modules/jquery/package.json
at FetchTask.utils.extend.next (file:my-app/node_modules/steal/ext/npm-crawl.js:532:11)
at file:my-app/node_modules/steal/ext/npm-crawl.js:556:33
at tryCatchReject (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1183:30)
at runContinuation1 (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:1142:4)
at Fulfilled.when (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:930:4)
at Pending.run (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:821:13)
at Scheduler._drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:97:19)
at Scheduler.drain (my-app/node_modules/steal/node_modules/steal-systemjs/node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js:62:9)
at nextTickCallbackWith0Args (node.js:436:9)
at process._tickCallback (node.js:365:13)
If the double jQuery installation is the issue, it should be resolved by version 2.0.0, which is exactly the same as the 1.0 version, but requires that you pass in a jQuery package as the jquery option. So, in addition to whatever else you had in your can-connect-feathers config, you'll need to provide the jquery option:
import $ from 'jquery'
import Feathers from 'can-connect-feathers';
new Feathers({
jquery: $
});

Jekyll Error - "serve" only works once

Started working on an update to my website. It was working fine the other day but now I get an error.
I generally type on CMD (i'm on Windows 10) "bundle exec Jekyll serve --watch" and the server goes. I can edit and save and its all reflected in browser upon refresh.
Now I can do this, but if I make one change to any file it works. Do another change and I get an error. I have to terminate and type again.
Below is the error:
D:\Tristen Grant\Documents\GitHub\portfolio>bundle exec jekyll serve --watch
DL is deprecated, please use Fiddle
Configuration file: D:/Tristen Grant/Documents/GitHub/portfolio/_config.yml
Source: D:/Tristen Grant/Documents/GitHub/portfolio
Destination: D:/Tristen Grant/Documents/GitHub/portfolio/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 0.595 seconds.
Auto-regeneration: enabled for 'D:/Tristen Grant/Documents/GitHub/portfolio'
Configuration file: D:/Tristen Grant/Documents/GitHub/portfolio/_config.yml
Server address: http://127.0.0.1:3000//
Server running... press ctrl-c to stop.
Regenerating: 1 file(s) changed at 2016-09-06 16:16:28 ...done in 0.521498 seconds.
Regenerating: 1 file(s) changed at 2016-09-06 16:16:30 ...error:
Error: No such file or directory - git rev-parse HEAD
Error: Run jekyll build --trace for more information.
[2016-09-06 16:19:35] ERROR Errno::ENOTSOCK: An operation was attempted on something that is not a socket.
C:/Ruby21-x64/lib/ruby/2.1.0/webrick/server.rb:170:in `select'
Terminate batch job (Y/N)? y
Terminate batch job (Y/N)? y
I'm using Ruby 2.1.5 64 bit version. RubyDevKit, Sass, Bourbon.
Any ideas how to fix this? I don't know much about Jekyll or ruby. Just starting out.
I also get this error in CMD. You should have github's desktop app installed; try running the same commands from the GitShell you get with that app.
For me that works, it saves me the trouble of installing git globally on Windows and setting it up.

Switching NodeJs application to debug mode from within it's process

I have a NodeJs module "some-module" that I want to have installed globally so it can be run directly from the command line without the node executable prefix. ie: $> some-module [args] I would like one of those arguments to be --debug. The reasoning for this is that I don't want to require users of this module to install it to their local directory just to run node --debug-brk node_modules/some-module/[path to entry point] [args].
The NodeJs documentation states in it's advanced usages section on debugging (http://nodemanual.org/latest/nodejs_ref_guide/debugging.node.js.html)
The V8 debugger can be enabled and accessed either by starting Node.js with the --debug command-line flag or by signaling an existing Node.js process with SIGUSR1.
I tried doing this with:
process.kill(process.pid, 'SIGUSR1');
Which produced the error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Unknown signal: SIGUSR1
at EventEmitter.kill (node.js:366:17)
at Object.<anonymous> (c:\dev\some-module\app.js:94:17)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
What do I need to do to get the running process switched to debug mode?
Also, I would like to debug the given application with node-inspector.
I'm not quite sure if I understood your question, but...
You can probably install an app globally and have it stop in a breakpoint using npm. In package.json put:
...
"scripts": {"start": "node --debug-brk some-module.js"},
"bin" : { "some-module" : "./some-module.js" },
...
Running npm start -g some-module will break at first line.
You can then use node-inspector for debugging.
About the part with stopping from within the code, node has a build in debugger (which is quite rudimentary), but it allows this functionality.
If you include somewhere in the code:
debugger;
and run:
node debug some-module.js
it will stop there in the debugger (note: this is not the same as node-inspector, i don't know if this can be achieved with node-inspector).
Don't really understand the reason why you're doing this, but hope this helps.

Resources