Cannot find module 'fs-extra' in CI Pipeline - npm

Recently I've made some changes to the cypress project, adding the configFiles as per the documentation explains.
https://docs.cypress.io/api/plugins/configuration-api#Switch-between-multiple-configuration-files
Once done that the bitbucket pipeline keeps on failing throwing this error.
[69:0503/090921.933433:ERROR:zygote_host_impl_linux.cc(263)] Failed to adjust OOM score of renderer with pid 264: Permission denied (13)
[264:0503/090921.979708:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is swiftshader, ANGLE is
Your pluginsFile is invalid: /opt/atlassian/pipelines/agent/build/cypress/plugins/index.js
It threw an error when required, check the stack trace below:
Error: Cannot find module 'fs-extra'
Require stack:
- /opt/atlassian/pipelines/agent/build/cypress/plugins/index.js
- /root/.cache/Cypress/9.6.0/Cypress/resources/app/packages/server/lib/plugins/child/run_plugins.js
- /root/.cache/Cypress/9.6.0/Cypress/resources/app/packages/server/lib/plugins/child/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
Does anyone have a clue as to why is that? I've tried multiple things with different docker images, changed the ts file to a js one, included the "pluginsFile": "cypress/plugins/index.js" in the cypress.json file, removing the node modules and the package-lock file and reinstalling. Nothing seems to work.
Something worth mentioning is that this only occurs when trying to run the project using the bitbucket pipeline and the cypress/included:9.6.0 docker image

Related

Cannot use import statement outside a module when using wrangler v2

I'm new to using cloudflare and wrangler. I've a project that I've been working on, and I'm now trying to deploy it using wrangler publish, but I keep running into issues. My product is coded in node.js, and I'm using version 2 of wrangler. When I execute wrangler publish I get:
Basic JavaScript project found. Skipping unnecessary build!
Error: Something went wrong with the request to Cloudflare...
Uncaught SyntaxError: Cannot use import statement outside a module
at worker.js:2Basic JavaScript project found. Skipping unnecessary build!
Error: Something went wrong with the request to Cloudflare...
Uncaught SyntaxError: Cannot use import statement outside a module
at worker.js:2
I've searched for a solution, and one of them that I found said to change module in wrangler.toml from type="javascript"to type="webpack" however that gives me a bunch of errors:
./node_modules/destroy/index.js
Module not found: Error: Can't resolve 'fs' ... Parsed request is a module...resolve as module
/Users/Desktop/APIs/cpiCalculator2/node_modules/destroy/node_modules doesn't exist or is not a directory
...
Error: webpack returned an error. You may be able to resolve this issue by running npm install.
I've tried reinstalling npm as it suggests and then wrangler publish again, but that just gives me the same error message.
I'm really not sure what the issue is, and I would really appreciate any help or advice on how to resolve this issue. Thank you!
Also, just a note, I'm not sure if this is affecting it, but I do have two other js documents in the main area of my project (where my index.js file is).

Cannot find module '../.../app/constants' when running npx #adobe/reactor-sandbox

I'm developing an extension in the Adobe Launch API, and everything was working fine with the command until this morning. Now when I run it, I receive the following error.
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '../../app/constants'
Require stack:
- D:\coding_projects\node_modules\#adobe\reactor-sandbox\src\tasks\constants\files.js
- D:\coding_projects\node_modules\#adobe\reactor-sandbox\src\tasks\helpers\getExtensionDescriptor.js
- D:\coding_projects\node_modules\#adobe\reactor-sandbox\src\tasks\run.js
- D:\coding_projects\node_modules\#adobe\reactor-sandbox\src\cli.js
I've tried reinstalling the individual package, as well as running npm install as a whole. My project has never contained a
../../app/constants
and has worked before without this error. Any ideas?

Meteor application not deploying, Errors prevented startup

I cloned the rocket chat repo on GitHub and ran meteor npm install && meteor, it wasn't able to deploy the app and got stuck, so I exited and tried meteor but it throws the same error:
Errors prevented startup:
While loading plugin `Livechat` from package `rocketchat:livechat`:
child_process.js:635:11: Command failed: C:\web dev\RocketChat\Rocket.Chat\packages\rocketchat-livechat\plugin/build.bat
'C:\web' is not recognized as an internal or external command,
operable program or batch file.
at checkExecSyncError (child_process.js:635:11)
at execSync (child_process.js:671:15)
at module (packages/Livechat/plugin/build-livechat.js:20:2)
at fileEvaluate (packages/modules-runtime.js:336:7)
at Module.require (packages/modules-runtime.js:238:14)
at require (packages/modules-runtime.js:258:21)
at <runJavaScript-36>:94:1
at <runJavaScript-36>:99:3
Your application has errors. Waiting for file change.
Started MongoDB.
And gets stuck there.
The issue here is with the space in the name of your web deb folder. This should probably be compensated for in the package code, but since it isn't the easiest solution would be to rename your folder to not have a space in the name and then maybe file a issue in the appropriate repo.

Configuring protractor with cucumber in Intellij

I am trying to configure Protractor with Cucumber in Intellij But I have an error when I run the test with the current configuration.
run configuration
I am receiving the error bellow
Testing started at 18:30 ...
/usr/local/bin/node /Users/marianojover/IdeaProjects/AutomationTest_PRO/node_modules/cucumber/bin/cucumber /Users/marianojover/IdeaProjects/AutomationTest_PRO/features/test.feature --format "../../../Library/Application Support/IntelliJIdea2018.1/CucumberJavaScript/lib/cucumberjs_formatter_v2.js" --format-options "{\"cucumberLibPath\": \"/Users/marianojover/IdeaProjects/AutomationTest_PRO/node_modules/cucumber/lib\"}" --require /Users/marianojover/IdeaProjects/AutomationTest_PRO/features
internal/modules/cjs/loader.js:583
throw err;
^
Error: Cannot find module '/Users/marianojover/IdeaProjects/AutomationTest_PRO/node_modules/cucumber/bin/cucumber'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:236:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:560:3)
Process finished with exit code 1
The error is not giving information that I can consider useful in order to solve the problem.
Running Cucumber.js 4.x is not currently supported, please follow WEB-33787 for updates
Please make sure you have cucumber added to the node_modules folder which is in your project directory. I hope it is there by looking at the paths in your run configuration.
You can also add cucumber cli path to "Cucumber.js arguments" in your run configuration. The path to add is ./node_modules/.bin/cucumber-js (should be modified based on your directory structure). Please see https://github.com/cucumber/cucumber-js/blob/master/docs/cli.md
If the above does not work then you can also use node.js runner to run your protractor test. Just add a new run configuration and add node.js and then add the parameters in configuration tab of the runner, some are given below -
Working Directory -> This will be the path to your project.
Javascript File -> node_modules\protractor\built\cli.js
Application Paramters -> --specs=<path to your feature file><space><path to your protractor.conf.js>

react native watchmanResponse unable to resolve root

There is an error when I build my react-native project with the version 0.20.0:
Looking for JS files in
/Users/rockyl/WorkSpaces/react-native/TinySNS
[13:55:06] <START> Building Dependency Graph
[13:55:06] <START> Crawling File System
[13:55:06] <START> Loading bundles layout
[13:55:06] <END> Loading bundles layout (1ms)
[Hot Module Replacement] Server listening on /hot
React packager ready.
ERROR unable to resolve root /Users/rockyl/WorkSpaces/react-native/TinySNS: failed to opendir(/Users/rockyl/WorkSpaces/react-native/TinySNS): No such file or directory
{"watchmanResponse":{"version":"4.4.0","error":"unable to resolve root /Users/rockyl/WorkSpaces/react-native/TinySNS: failed to opendir(/Users/rockyl/WorkSpaces/react-native/TinySNS): No such file or directory"}}
Error: unable to resolve root /Users/rockyl/WorkSpaces/react-native/TinySNS: failed to opendir(/Users/rockyl/WorkSpaces/react-native/TinySNS): No such file or directory
at BunserBuf.<anonymous> (/Users/rockyl/WorkSpaces/react-native/TinySNS/node_modules/react-native/node_modules/sane/node_modules/fb-watchman/index.js:95:23)
at emitOne (events.js:77:13)
at BunserBuf.emit (events.js:169:7)
at BunserBuf.process (/Users/rockyl/WorkSpaces/react-native/TinySNS/node_modules/react-native/node_modules/bser/index.js:289:10)
at /Users/rockyl/WorkSpaces/react-native/TinySNS/node_modules/react-native/node_modules/bser/index.js:244:12
at doNTCallback0 (node.js:419:9)
at process._tickCallback (node.js:348:13)
See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
here is the logs:
and here is the real-time logs:
But the root path truly exists.
Thanks for posting those logs; what's happening here is an issue with the casing of the WorkSpaces directory in that path that is being watched. There's some complicated background to this that results in watchman needing to know the exact casing of the file names so that we can report on case-change-only-renames.
The TL;DR is that you should either ask React Native to watch the path using Workspaces as the directory name, or rename the directory so that it is actually WorkSpaces (in other words, make sure that the path you're asking for exactly matches that of the filesystem).
There are a couple of watchman bugs here that I'll work on fixing in the meantime:
We should canonicalize this path using our strict canon at the earlier stage in watching (should make this use case "just work")
We should surface this error with this explanation when such a mismatch occurs
In short: Just rename the containing folder where your project is located to workspaces (All in lowercase), an example here: