I am getting this problem every time whenever i run npm start in react - react-scripts

Error: Cannot find module 'C:\Users\ashuk\Desktop\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
enter image description here

Related

Why cypress config is invalid when I try to run npx cypress open?

I've already installed cypress and I once successfully open it and run some example test cases. I don't know why when I try to open it again with command npx cypress open in vscode it says
Cypress Configuration Error
This is the stack trace:
Error: Cannot find module 'cypress'
Require stack:
- C:\Users\janna\Documents\Miftah's folder\Learn\Cypress\gitRepo\ngx-cypress-test\cypress.config.js
- C:\Users\janna\AppData\Local\Cypress\Cache\10.6.0\Cypress\resources\app\node_modules\#packages\server\lib\plugins\child\run_require_async_child.js
- C:\Users\janna\AppData\Local\Cypress\Cache\10.6.0\Cypress\resources\app\node_modules\#packages\server\lib\plugins\child\require_async_child.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (C:\Users\janna\AppData\Local\Cypress\Cache\10.6.0\Cypress\resources\app\node_modules\#cspotcode\source-map-support\source-map-support.js:679:30)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Users\janna\Documents\Miftah's folder\Learn\Cypress\gitRepo\ngx-cypress-test\cypress.config.js:1:26)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at loadFile (C:\Users\janna\AppData\Local\Cypress\Cache\10.6.0\Cypress\resources\app\node_modules\#packages\server\lib\plugins\child\run_require_async_child.js:89:14)
at EventEmitter. (C:\Users\janna\AppData\Local\Cypress\Cache\10.6.0\Cypress\resources\app\node_modules\#packages\server\lib\plugins\child\run_require_async_child.js:116:38)
at EventEmitter.emit (node:events:527:28)
at EventEmitter.emit (node:domain:475:12)
You can fix that file with watchForFileChanges: false,
const { defineConfig } = require("cypress");
module.exports = defineConfig({
e2e: {
watchForFileChanges: false,
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});

When I run this command to deploy the solana contract this error is reported

So when I run this
ts-node C:\Users\ras zebi\Desktop\solana boobs\metaplex-master\js\packages\cli\src\candy-machine-v-cli.ts upload -e devnet -k C:\Users\ras zebi\Desktop\solana boobs\keypair\my-keypair.json -cp C:\Users\ras zebi\Desktop\solana boobs\metaplex-master\js\packages\cli\example-candy-machine-upload-config.json C:\Users\ras zebi\Desktop\solana boobs\metaplex-master\my assets
I get this
Error: Cannot find module './ras'
Require stack:
- C:\Users\imaginaryUncacheableRequireResolveScript
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
at requireResolveNonCached (C:\Users\ras zebi\AppData\Roaming\npm\node_modules\ts-node\dist\bin.js:496:16)
at getProjectSearchDir (C:\Users\ras zebi\AppData\Roaming\npm\node_modules\ts-node\dist\bin.js:466:40)
at phase3 (C:\Users\ras zebi\AppData\Roaming\npm\node_modules\ts-node\dist\bin.js:268:27)
at bootstrap (C:\Users\ras zebi\AppData\Roaming\npm\node_modules\ts-node\dist\bin.js:44:30)
at main (C:\Users\ras zebi\AppData\Roaming\npm\node_modules\ts-node\dist\bin.js:32:12)
at Object.<anonymous> (C:\Users\ras zebi\AppData\Roaming\npm\node_modules\ts-node\dist\bin.js:526:5)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'C:\\Users\\imaginaryUncacheableRequireResolveScript' ]
What can I try to fix this?

Run WebdriverIO tests via Mocha in WebStorm

I want to run WebdriverIO + Mocha tests from the WebStorm gutter (the green triangle icons on the left side, by the line numbers).
But when I press run triangle - error occurred:
/Users/ilyubin/.nvm/versions/node/v10.15.0/bin/node /Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/bin/_mocha --ui bdd --reporter /Applications/WebStorm.app/Contents/plugins/NodeJS/js/mocha-intellij/lib/mochaIntellijReporter.js /Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/test/specs/catalog/not.found.page.spec.js --grep "^Тесты страницы ошибок Поиск несуществующего запроса$"
/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/test/specs/catalog/not.found.page.spec.js:1
(function (exports, require, module, __filename, __dirname) { import {expect} from 'chai';
^
SyntaxError: Unexpected token {
at new Script (vm.js:79:7)
at createScript (vm.js:251:10)
at Object.runInThisContext (vm.js:303:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at /Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/lib/mocha.js:324:27
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/lib/mocha.js:321:14)
at Mocha.run (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/lib/mocha.js:763:10)
at Object.exports.singleRun (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/lib/cli/run-helpers.js:196:16)
at exports.runMocha (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/lib/cli/run-helpers.js:291:13)
at Object.exports.handler.argv [as handler] (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/lib/cli/run.js:292:3)
at Object.runCommand (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/node_modules/yargs/lib/command.js:238:44)
at Object.parseArgs [as _parseArgs] (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/node_modules/yargs/yargs.js:1072:28)
at Object.parse (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/node_modules/yargs/yargs.js:566:25)
at Object.exports.main (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/lib/cli/cli.js:62:6)
at Object.<anonymous> (/Users/ilyubin/git/ozon.ru/packages/ozon.ru-ui-tests/node_modules/mocha/bin/_mocha:10:23)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
How to run WebdriverIO tests from WebStorm?
My versions:
WebStorm 2018.3.3
Build #WS-183.5153.33, built on January 9, 2019
JRE: 1.8.0_152-release-1343-b26 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.2
➜ ~ node -v
v10.15.0
➜ ~ mocha --version
5.2.0
My dependencies:
"dependencies": {
"#wdio/allure-reporter": "^5.4.9",
"#wdio/cli": "^5.4.13",
"#wdio/local-runner": "^5.4.13",
"#wdio/mocha-framework": "^5.4.13",
"#wdio/spec-reporter": "^5.4.3",
"#wdio/sync": "^5.4.13",
...
},
You can't run wdio specs using mocha test runner, so Mocha run configuration can't be used here. You need using Node.js run configuration instead:
Also, as you are using ES6 syntax in your tests, you have to configure wdio to use babel. See https://webdriver.io/docs/babel.html for instructions:
npm install --save-dev #babel/core #babel/cli #babel/preset-env #babel/register
in the project root folder, create a file babel.config.js:
module.exports = {
presets: [
['#babel/preset-env', {
targets: {
node: 8
}
}]
]
}
in your wdio.conf.js, set up mocha as follows;
mochaOpts: {
ui: 'bdd',
timeout: 60000,
compilers: ['js:#babel/register']
},

Can't run geoproject from d3-geo-projection

I'm trying to follow Mike Bostok tutorial. Every time I want to run geoproject I obtain the following error:
/usr/local/lib/node_modules/d3-geo-projection/bin/geoproject:5
d3 = Object.assign({}, require("d3-geo"), require("../")),
^
TypeError: undefined is not a function
at Object.<anonymous> (/usr/local/lib/node_modules/d3-geo-projection/bin/geoproject:5:17)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3

Error: Timed out waiting for the WebDriver server at http://localhost:4444/wd/hub

When I run my webdriverjs, jasmine-node tests I am getting following error.
Error: Timed out waiting for the WebDriver server at http://172.19.35.25:4444/wd/hub
at Error (<anonymous>)
at onResponse (/mnt/javascript-framework/JSTESTING/Jasmine2/node_modules/selenium-webdriver/http/util.js:87:11)
at /mnt/javascript-framework/JSTESTING/Jasmine2/node_modules/selenium-webdriver/http/util.js:42:21
at /mnt/javascript-framework/JSTESTING/Jasmine2/node_modules/selenium-webdriver/lib/webdriver/http/http.js:96:5
at ClientRequest.<anonymous> (/mnt/javascript-framework/JSTESTING/Jasmine2/node_modules/selenium-webdriver/http/index.js:145:7)
at ClientRequest.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1551:9)
at Socket.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:419:13)
==== async task ====
WebElement.click()
at webdriver.WebDriver.schedule (/mnt/javascript-framework/JSTESTING/Jasmine2/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:302:15)
at webdriver.WebElement.schedule_ (/mnt/javascript-framework/JSTESTING/Jasmine2/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:1665:23)
at webdriver.WebElement.click (/mnt/javascript-framework/JSTESTING/Jasmine2/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:1770:15)
at Object.<anonymous> (/mnt/javascript-framework/JSTESTING/Jasmine2/jasmine2-standalone/spec/ospFunctionalTestSpec.js:91:96)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
I have tried following options but no luck
jasmine.getEnv().defaultTimeoutInterval = 600000;
driver.manage().timeouts().pageLoadTimeout(300000);
driver.manage().timeouts().implicitlyWait(600000);
driver.manage().timeouts().setScriptTimeout(7200000);
Any idea how can I make it work?

Resources