I have a problem that electron-updater cannot find module 'fs/promises'. All another solutions don`t help me. Here is my log.
Error: Cannot find module 'fs/promises'
Require stack:
- E:\VSProjects\Launcher_JS\node_modules\electron-updater\out\AppUpdater.js
- E:\VSProjects\Launcher_JS\node_modules\electron-updater\out\main.js
- E:\VSProjects\Launcher_JS\src\index.js
- E:\VSProjects\Launcher_JS\node_modules\electron-prebuilt-compile\lib\es6-init.js
- E:\VSProjects\Launcher_JS\node_modules\electron-prebuilt-compile\node_modules\electron\dist\resources\default_app.asar\main.js
-
at Module._resolveFilename (internal/modules/cjs/loader.js:798:15)
at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (electron/js2c/browser_init.js:7607:16)
at Module._load (internal/modules/cjs/loader.js:691:27)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Module.require (internal/modules/cjs/loader.js:853:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (E:\VSProjects\Launcher_JS\node_modules\electron-updater\out\AppUpdater.js:8:20)
at Module._compile (internal/modules/cjs/loader.js:968:30)
at Object.require.extensions.<computed> [as .js] (E:\VSProjects\Launcher_JS\node_modules\electron-compile\lib\require-hook.js:77:14)
package.json contains
"dependencies": {
"#electron/remote": "^2.0.8",
"electron-compile": "^6.4.4",
"electron-squirrel-startup": "^1.0.0",
"electron-updater": "^4.6.5",
"fs-extra": "^10.0.1",
"react": "^17.0.2",
"sound-play": "^1.1.0",
"update-electron-app": "^2.0.1"
},
"devDependencies": {
"#types/node": "^17.0.21",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"electron": "^17.1.2",
"electron-builder": "^22.14.13",
"electron-forge": "^5.2.4",
"electron-prebuilt-compile": "8.2.0",
"electron-winstaller": "^5.0.0",
"eslint": "^3.19.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.29.3",
"jquery": "^3.6.0"
}
Reinstallation of node_modules did not help me. Node.js have version 16.14.0
Delete yarn.lock and node_modules and run
yarn install
again
I tried to upgrade the node version, rolled back the version to the old one and started getting typescript errors that weren't there before.
I understand that my question will seem stupid to many and even get disadvantages, but I really do not know much about this issue.
But now the project does not run locally with exactly the same version of the wizard (the same package.json) with which everything worked
I need to start, I will raise the typescript version in the future and solve all existing problems, but now I urgently need to solve another, and I cannot even start.
Could this also happen due to the fact that when I updated node I used the following commands, including clearing the cache as I understand it:
npm cache clean -f
sudo npm install -g n
// package.json
{
"name": "projectname",
"version": "1.0.0",
"main": "index.js",
"description": "project description",
"private": true,
"scripts": {
"dev": "DEBUG=projectname:* DEBUG_DEPTH=5 nodemon server/server.ts",
"build": "next build && tsc --project tsconfig.server.json",
"start": "NODE_ENV=production LANG=en node .next/production-server/server/server.js",
"postbuild": "cp -r static .next/",
"analyze": "BUNDLE_ANALYZE=both yarn build"
},
"dependencies": {
"#zeit/next-bundle-analyzer": "^0.1.2",
"#zeit/next-css": "^1.0.1",
"#zeit/next-sass": "^1.0.1",
"#zeit/next-typescript": "^1.1.1",
"app-root-path": "^2.1.0",
"aws-sdk": "^2.404.0",
"bbcode-to-react": "^0.2.9",
"bcrypt": "^3.0.6",
"body-parser": "^1.18.3",
"chart.js": "^2.7.3",
"compression": "^1.7.3",
"connect-memcached": "^1.0.0",
"connect-memjs": "^0.2.1",
"connect-mongo": "^2.0.1",
"cookie-parser": "^1.4.3",
"cookie-session": "^1.3.3",
"cron": "^1.7.0",
"cross-fetch": "^3.0.1",
"csv-parse": "^4.4.1",
"debug": "^4.1.1",
"diff": "^3.5.0",
"export-to-csv": "^0.2.1",
"express": "^4.16.3",
"express-http-proxy": "^1.5.1",
"express-session": "^1.15.6",
"find-remove": "^1.2.2",
"form-data": "^3.0.0",
"geoip-lite": "^1.3.8",
"humps": "^2.0.1",
"immutable": "^3.8.2",
"js-base64": "^2.5.2",
"json-immutable": "^0.4.0",
"jsonwebtoken": "^8.3.0",
"locale": "^0.1.0",
"lodash": "^4.17.10",
"lru-cache": "^5.1.1",
"md5": "^2.2.1",
"mic-recorder-to-mp3": "^2.2.1",
"moment-timezone": "0.3.0",
"mongoose": "^5.2.9",
"multer": "^1.3.1",
"next": "^8.0.3",
"next-compose-plugins": "^2.1.1",
"next-cookies": "^1.1.2",
"next-redux-wrapper": "^3.0.0-alpha.2",
"next-routes": "^1.4.2",
"node-sass": "^4.9.3",
"nodemailer": "^4.6.8",
"normalizr": "^3.2.4",
"passport": "^0.4.0",
"passport-custom": "^1.1.0",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"paypal-rest-sdk": "^1.8.1",
"pmx": "^1.6.7",
"query-string": "^6.2.0",
"rc-slider": "^8.6.3",
"react": "^16.8.4",
"react-beautiful-dnd": "^9.0.2",
"react-chartjs-2": "^2.7.4",
"react-collapse": "^4.0.3",
"react-copy-to-clipboard": "^5.0.1",
"react-cropper": "^1.0.1",
"react-csv": "^1.0.19",
"react-datasheet": "^1.3.14",
"react-day-picker": "^7.3.0",
"react-dom": "^16.8.4",
"react-dropzone": "^5.1.0",
"react-flags": "^0.1.17",
"react-ga": "^2.6.0",
"react-google-recaptcha": "^1.0.5",
"react-infinite-scroller": "^1.2.4",
"react-joyride": "^2.0.5",
"react-js-pagination": "^3.0.2",
"react-lazy-load": "^3.0.13",
"react-mic-record": "^1.0.6",
"react-modal": "^3.8.1",
"react-player": "^1.6.6",
"react-quill": "^1.3.3",
"react-redux": "^6.0.1",
"react-select": "^2.1.0",
"react-share": "^2.4.0",
"react-sizeme": "^2.5.2",
"react-to-print": "^2.4.0",
"read-excel-file": "^4.0.7",
"redux": "^4.0.0",
"redux-form": "^8.1.0",
"redux-saga": "^0.16.0",
"set-value": "^3.0.0",
"shelljs": "^0.8.2",
"shortid": "^2.2.13",
"slugify": "^1.3.4",
"socket.io": "^2.2.0",
"socket.io-client": "^2.2.0",
"socket.io-redis": "^5.2.0",
"twig": "^1.12.0",
"typegoose": "^5.2.1",
"uuid": "^3.3.2"
},
"devDependencies": {
"#babel/plugin-proposal-decorators": "^7.1.0",
"#types/body-parser": "^1.17.0",
"#types/connect-mongo": "^0.0.38",
"#types/cookie-parser": "^1.4.1",
"#types/debug": "^4.1.0",
"#types/express": "^4.16.0",
"#types/express-session": "^1.15.10",
"#types/mongodb": "^3.1.4",
"#types/mongoose": "^5.2.6",
"#types/multer": "^1.3.7",
"#types/node": "^10.7.1",
"#types/passport": "^0.4.6",
"#types/passport-local": "^1.0.33",
"#types/react": "^16.4.11",
"#types/react-dom": "^16.0.7",
"#types/redux-form": "^7.4.7",
"#types/set-value": "^2.0.0",
"#types/shortid": "^0.0.29",
"autoprefixer": "^9.4.3",
"babel-plugin-module-resolver": "^3.1.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-plugin-wrap-in-js": "^1.1.1",
"css-purify-webpack-loader": "^1.0.1",
"eslint": "^5.4.0",
"eslint-plugin-react": "^7.11.1",
"faker": "^4.1.0",
"next-purgecss": "^3.0.1",
"next-size": "^2.0.2",
"optimize-css-assets-webpack-plugin": "^5.0.1",
"purgecss-whitelister": "^2.3.1",
"stylelint-config-recommended": "^2.1.0",
"tailwindcss": "^0.7.4",
"ts-node": "^7.0.1",
"typescript": "^3.0.1",
"webpack-pwa-manifest": "^4.0.0"
}
}
// ts-node -v =>
ts-node v7.0.1
node v10.19.0
typescript v3.0.1
cache "/tmp/ts-node-83......"
[UPDATED] I changed "typescript": "^3.0.1" > "typescript": "3.0.1", and in project v3.0.1 now, global v3.7.5
I switch them to VSCode and it does not underline anything, I also took a commit where I made corrections when I tried to raise versions of all packages, but I used the original package.json, and now it swears at the import format (If I understand correctly, this import format goes in later versions: import moment from 'moment-timezone'):
// utils.ts:
import * as moment from 'moment-timezone';
// traceback error
/home/roma/project/app/utils.ts:379
value: {startDate: moment().startOf('day').unix() * 1000, endDate: moment().unix() * 1000},
TypeError: moment is not a function
at Object.<anonymous> (/home/roma/project/app/utils.ts:379:29)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module.m._compile (/home/roma/project/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/roma/project/node_modules/ts-node/src/index.ts:442:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/roma/project/server/models/user.ts:10:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module.m._compile (/home/roma/project/node_modules/ts-node/src/index.ts:439:23)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/home/roma/project/node_modules/ts-node/src/index.ts:442:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
[nodemon] app crashed - waiting for file changes before starting...
P.S. In the future, I still plan to update all packages to the latest versions including node as required by Next.js v11. What is the best and most correct way to do this so that while work is underway to be able to quickly switch to support the site and resolve urgent problems, without facing such a situation as it is now?
I am using webdriverIO v7 (latest stable version) and cucumber.
I get that error: Error: The "from" argument must be of type string. Received undefined
This is the stack trace:
2021-04-08T18:29:37.403Z ERROR #wdio/runner: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
at validateString (internal/validators.js:120:11)
at Object.relative (path.js:437:5)
at getDefinitionLineAndUri (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:184:27)
at buildStepDefinitionConfig (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:124:7)
at SupportCodeLibraryBuilder.defineStep (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\index.js:51:79)
at Object.<anonymous> (C:\my-project\src\step_definitions\/accountSummary_steps.js:6:1)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Module._compile (C:\my-project\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Object.newLoader [as .js] (C:\my-project\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Module._load (internal/modules/cjs/loader.js:878:14)
at Function.hookedLoader [as _load] (C:\my-project\node_modules\mockery\mockery.js:111:12)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at C:\my-project\node_modules\#wdio\cucumber-framework\build\index.js:204:13
In my accountSummary_steps.js on line 6 is only this:
import loggedInHeaderModule from "../pages/modules/loggedInHeaderModule"
import accountSummaryPage from "../pages/accountSummaryPage"
import {Then, When} from 'cucumber';
When(/^I click on My account details link$/, function () { // This is line 6
loggedInHeaderModule.openAccountSummary();
});
This is my package.json dependencies:
"dependencies": {
"#babel/cli": "^7.2.3",
"#babel/plugin-proposal-export-default-from": "^7.5.2",
"#babel/preset-env": "^7.4.2",
"#babel/register": "^7.4.0",
"#types/cucumber": "^7.0.0",
"#wdio/cli": "^7.3.1",
"#wdio/config": "^7.3.1",
"#wdio/cucumber-framework": "^7.3.1",
"#wdio/local-runner": "^7.3.1",
"#wdio/selenium-standalone-service": "^7.3.1",
"#wdio/spec-reporter": "^7.3.1",
"#wdio/sync": "^7.3.1",
"chai": "^4.3.4",
"cucumber": "^6.0.5",
"eslint-plugin-wdio": "^7.0.0",
"file-system": "^2.2.2",
"mjpeg-consumer": "^2.0.0",
"node-fetch": "^2.6.1",
"webdriverio": "^7.3.1",
"yarn": "^1.22.10"
},
"devDependencies": {
"#babel/core": "^7.4.0",
"#wdio/allure-reporter": "^7.3.1",
"#wdio/browserstack-service": "^7.3.1",
"#wdio/junit-reporter": "^7.3.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"eslint": "^7.23.0",
"eslint-plugin-import": "^2.22.1",
"forever": "^3.0.4",
"jest": "^26.6.3",
"npm-run-all": "^4.1.5"
}
Anybody has any idea what went wrong there?
Thanks!
I managed to resolve it by removing "cucumber": "^6.0.5" dependency and using "#cucumber/cucumber": "^7.1.0" instead in package.json file.
In my steps file I imported statements like this:
import {Then, When} from '#cucumber/cucumber';
Instead of this:
import {Then, When} from 'cucumber';
It seems it is the new way how webdriverIO v7 is integarted with cucumber. (Like described here in docs)
I'm trying to start my API with node but this error appears :
$ node ./.local/start.js
module.js:549
throw err;
^
Error: Cannot find module '/c/Users/$AAU000-TFETR2QTBK6P/Desktop/Stage/whasq-api-master/package.json'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at ConfigurationManager.getPackageConfig (C:\Users\$AAU000-TFETR2QTBK6P\Desktop\Stage\whasq-api-master\node_modules\#rduk\configuration\lib\manager.js:61:15)
at getDocument (C:\Users\$AAU000-TFETR2QTBK6P\Desktop\Stage\whasq-api-master\node_modules\#rduk\configuration\lib\manager.js:74:31)
at ConfigurationManager.getSection (C:\Users\$AAU000-TFETR2QTBK6P\Desktop\Stage\whasq-api-master\node_modules\#rduk\configuration\lib\manager.js:106:19)
at ConfigurationManager.get (C:\Users\$AAU000-TFETR2QTBK6P\Desktop\Stage\whasq-api-master\node_modules\#rduk\configuration\lib\manager.js:93:25)
at Object.<anonymous> (C:\Users\$AAU000-TFETR2QTBK6P\Desktop\Stage\whasq-api-master\index.js:14:38)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
The real problem is that the file package.json is present..
ls -a (at ~/Desktop/Stage/whasq-api-master)
./ ../ .circleci/ .gitignore .local/ api/ config/ ecosystem.config.js index.js lib/ node_modules/ package.json package-lock.json README.md sf_certificate/ templatesES.md
//package.json content
{
"name": "whasq-api",
"version": "0.1.1",
"description": "whasq-api",
"engines": {
"node": ">=8.11.1"
},
"main": "index.js",
"scripts": {
"pretest": "standard --fix",
"test": "exit 0"
},
"author": "WhASQ",
"license": "ISC",
"dependencies": {
"#rduk/configuration": "^2.2.3",
"#rduk/errors": "^1.3.1",
"#rduk/logger": "^1.0.3",
"#rduk/logger-winston-loggly-factory": "0.1.0",
"#rduk/logger-winston-provider": "^1.0.4",
"#rduk/message-broker": "^2.4.0",
"#rduk/provider": "^3.1.3",
"#rduk/tasks-orchestrator": "^0.1.3",
"aws-sdk": "^2.256.1",
"axios": "^0.18.1",
"bcrypt": "^3.0.4",
"body-parser": "^1.18.2",
"csv": "^3.1.0",
"dotenv": "5.0.1",
"elasticsearch": "^16.4.0",
"express": "4.16.3",
"express-request-id": "^1.4.1",
"helmet": "^3.15.1",
"jsonwebtoken": "8.2.1",
"morgan": "^1.9.1",
"multer": "^1.3.1",
"orm": "^5.0.4",
"package.json": "^2.0.1",
"pg": "^7.4.1",
"react-s3-uploader": "^4.8.0",
"socket.io": "2.0.4",
"socketio-jwt": "4.5.0",
"standard": "11.0.1",
"swagger-express-mw": "0.7.0",
"winston": "2.4.0"
},
"directories": {
"lib": "lib"
},
"devDependencies": {},
"keywords": []
}
I tried a lot of things, like switch versions of Node, delete modules then reinstall them, and other stuff like that but I cannot solve this problem.
I'm using those versions :
npm 6.11.3 node 8.11.1 and I'm using GitBash (i tried Powershell but no change)
(I tried every single version of Node (>=8.11.1) and the error is the same every time)
ls -a (at ~/Desktop/Stage/whasq-api-master/.local)
.env start.js
//start.js content
require('dotenv').load({path: process.env.PWD + '/.local/.env'})
require('../')
//.env content
RDUK_CONFIG_PATH=config
RDUK_CONFIG_PREFIX=app
RDUK_CONFIG_EXT=.yaml
APP_PORT=6500
APP_SECRET=xxx
SF_SECRET=(hidden)
SF_CERTIFICATE=sf_certificate/public.pem
AMQP_ADDRESS=amqp://cawdev:cawdev#192.168.1.87:5672
LOGGLY_TOKEN=xxx
LOGGLY_SUBDOMAIN=xxx
LOGGLY_LOGIN=jessie
LOGGLY_PASSWORD=(hidden)
ES_ADDRESS=http://cawtest.net:9200/
DB_PROTOCOL=postgresql
DB_HOST=localhost
DB_PORT=5433
DB_NAME=mydb
DB_USER=esteban
DB_PASS=(hidden)
AWS_ACCESS_KEY_ID=(hidden)
AWS_SECRET_ACCESS_KEY=(hidden)
AWS_REGION=eu-west-3
AWS_BUCKET=(hidden)
I also tried to move my repository at C:/ to avoid potential problems with my username ($AAU000-TFETR2QTBK6P) because I thought that name could be mistaken for an environment variable.
The issue come from the way Windows interpret the npm library, I advise you to switch to a Linux or Mac environment..
my node is v0.12.7, and my grunt is grunt-cli v0.1.13 grunt v0.4.5.
the following is my dependencies in package.json.
"bower": "1.3.8",
"grunt": "0.4.5",
"grunt-bower": "0.18.0",
"grunt-cachebuster": "0.1.5",
"grunt-check-dependencies": "0.3.1",
"grunt-cli": "0.1.13",
"grunt-connect-proxy": "0.2.0",
"grunt-contrib-clean": "0.5.0",
"grunt-contrib-compress": "0.10.0",
"grunt-contrib-connect": "0.5.0",
"grunt-contrib-copy": "0.5.0",
"grunt-contrib-cssmin": "0.9.0",
"grunt-contrib-jshint": "0.11.0",
"grunt-contrib-requirejs": "0.4.4",
"grunt-contrib-watch": "0.5.3",
"grunt-git-describe": "2.3.2",
"grunt-karma": "0.10.1",
"grunt-replace": "0.8.0",
"grunt-requirejs": "0.4.2",
"grunt-shell": "0.6.4",
"grunt-version-copy-bower-components": "^0.1.11",
"jasmine-core": "2.2.0",
"karma": "0.12.31",
"karma-chrome-launcher": "0.1.7",
"karma-jasmine": "0.3.5",
"karma-phantomjs-launcher": "0.1.4",
"karma-requirejs": "0.2.2",
"karma-spec-reporter": "0.0.12",
"load-grunt-config": "0.13.2",
"path": "^0.11.14",
"requirejs": "2.1.16",
"shelljs": "0.3.0"
and the following is my gruntfile.js
require('load-grunt-config')(grunt, {
configPath: path.join(process.cwd(), 'tasks')
})
I search many materials which told me someone have fixed it. Could anyone help me to look into it?
My error stacks is
TypeError: Arguments to path.join must be strings
at Object.posix.join (path.js:488:13)
at Object.file.exists (/Users/zwshao/REA/widgets_new/node_modules/grunt/lib/grunt/file.js:381:28)
at task.loadTasks (/Users/zwshao/REA/widgets_new/node_modules/grunt/lib/grunt/task.js:371:18)
at Array.forEach (native)
at Task.task.init (/Users/zwshao/REA/widgets_new/node_modules/grunt/lib/grunt/task.js:457:33)
at Object.grunt.tasks (/Users/zwshao/REA/widgets_new/node_modules/grunt/lib/grunt.js:120:8)
at Object.module.exports [as cli] (/Users/zwshao/REA/widgets_new/node_modules/grunt/lib/grunt/cli.js:38:9)
at Object.<anonymous> (/usr/local/lib/node_modules/grunt-cli/bin/grunt:45:20)
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