The app built a couple of years ago using:
Angular v5.2.0
Angular-CLI v1.6.4
Electron v1.7.8
Electron Builder v20.0.5
Node 10.15.0
NPM 6.4.1
node-gyp 3.8.0
It was last compiled in September 2019 but now when run npm i after cloning from the repo getting the following error on electron-builder. Running on Windows 10 and Visual Studio Code. I've got the same error on MacOS Catalina.
PS C:\[Project\directory]> npm i
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade t
> [projectname-version]-beta postinstall C:\Pinro\8track-player
> electron-builder install-app-deps
• electron-builder version=20.0.5
• loaded configuration file=C:[project\directory]\electron-builder.json
Error: Application directory dist doesn't exists
at C:\[project\directory]\node_modules\electron-builder-lib\src\util\config.ts:140:13
From previous event:
at computeDefaultAppDirectory (C:\[project\directory]\node_modules\electron-builder-lib\out\util\config.js:131:22)
at C:\[project\directory]\node_modules\electron-builder\src\cli\install-app-deps.ts:52:78
at Generator.next (<anonymous>)
From previous event:
at installAppDeps (C:\[project\directory]\node_modules\electron-builder\out\cli\install-app-deps.js:51:21)
at then (C:\[project\directory]\node_modules\electron-builder\src\cli\cli.ts:48:33)
at runCallback (timers.js:705:18)
at tryOnImmediate (timers.js:676:5)
at processImmediate (timers.js:658:5)
From previous event:
at Object.args [as handler] (C:\[project\directory]\node_modules\electron-builder\src\cli\cli.ts:48:33)
at Object.runCommand (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\lib\command.js:235:44
at Object.parseArgs [as _parseArgs] (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\yargs.
at Object.get [as argv] (C:\[project\directory]\node_modules\electron-builder\node_modules\yargs\yargs.js:965:21)
at Object.<anonymous> (C:\[project\directory]node_modules\electron-builder\src\cli\cli.ts:42:15)
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)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [project-name-version]-beta postinstall: `electron-builder install-app-deps`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [project-name-version]-beta postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\[Project directory]\AppData\Roaming\npm-cache\_logs\2020-07-12T07_25_33_106Z-debug.log
PS C:\[Project\directory]>
package.json:
{
"name": "[project-name]",
"version": "[version-number]-beta",
"description": "",
"author": {
"name": "",
"email": ""
},
"keywords": [
"angular",
"angular 5",
"electron",
"typescript",
"sass"
],
"main": "main.js",
"private": true,
"scripts": {
"ng": "ng",
"lint": "ng lint",
"start": "tsc main.ts && npm-run-all --parallel webpack:watch electron:serve",
"webpack:watch": "webpack --watch",
"start:web": "webpack-dev-server --content-base . --port 4200 --inline",
"build:electron:main": "tsc main.ts --outDir dist && copyfiles package.json dist && cd dist && npm install --prod && cd ..",
"build": "webpack --display-error-details && npm run build:electron:main",
"build:prod": "cross-env NODE_ENV=production npm run build",
"electron:serve": "npm run build:electron:main && electron ./dist --serve",
"electron:test": "electron ./dist",
"electron:dev": "npm run build && electron ./dist",
"electron:prod": "npm run build:prod && electron ./dist",
"electron:linux": "npm run build:prod && npx electron-builder build --linux",
"electron:windows": "npm run build:prod && npx electron-builder build --windows",
"electron:mac": "npm run build:prod && npx electron-builder build --mac",
"rebuild": "electron-rebuild -f -w sqlite3 -v 1.8",
"test": "karma start ./karma.conf.js",
"pree2e": "webdriver-manager update --standalone false --gecko false --quiet && npm run build",
"e2e": "protractor ./protractor.conf.js",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"#types/bluebird": "3.5.20",
"electron-builder-squirrel-windows": "20.0.5",
"electron-rebuild": "^1.11.0",
"electron-squirrel-startup": "^1.0.0",
"sqlite3": "https://github.com/mapbox/node-sqlite3/tarball/master"
},
"devDependencies": {
"#angular-devkit/core": "^0.3.1",
"#angular/cli": "1.6.4",
"#angular/common": "5.2.0",
"#angular/compiler": "5.2.0",
"#angular/compiler-cli": "5.2.0",
"#angular/core": "5.2.0",
"#angular/forms": "5.2.0",
"#angular/http": "5.2.0",
"#angular/language-service": "5.2.0",
"#angular/platform-browser": "5.2.0",
"#angular/platform-browser-dynamic": "5.2.0",
"#angular/router": "5.2.0",
"#ng-bootstrap/ng-bootstrap": "1.1.1",
"#ngx-translate/core": "9.0.1",
"#ngx-translate/http-loader": "2.0.0",
"#types/core-js": "0.9.46",
"#types/jasmine": "2.5.54",
"#types/jasminewd2": "2.0.2",
"#types/lodash": "^4.14.50",
"#types/node": "^7.10.2",
"amplitudejs": "^3.2.3",
"autoprefixer": "7.1.4",
"bootstrap": "^4.0.0",
"chart.js": "^2.5.0",
"circular-dependency-plugin": "3.0.0",
"codelyzer": "3.2.0",
"copy-webpack-plugin": "4.1.1",
"copyfiles": "1.2.0",
"core-js": "2.4.1",
"cross-env": "5.0.5",
"crypto-js": "^3.1.9-1",
"css-loader": "0.28.7",
"cssnano": "3.10.0",
"diskspace": "^2.0.0",
"electron": "^1.8.8",
"electron-builder": "20.0.5",
"electron-builder-squirrel-windows": "20.0.5",
"electron-json-storage": "^4.0.2",
"electron-log": "^2.2.14",
"electron-reload": "1.2.2",
"electron-squirrel-startup": "^1.0.0",
"enhanced-resolve": "3.3.0",
"exports-loader": "0.6.4",
"file-loader": "1.1.5",
"html-loader": "0.5.1",
"html-webpack-plugin": "2.29.0",
"is-online": "^7.0.0",
"istanbul-instrumenter-loader": "3.0.0",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
"jquery": "^3.3.1",
"json-loader": "0.5.7",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-sourcemap-loader": "0.3.7",
"less-loader": "4.0.5",
"minimist": "1.2.0",
"mkdirp": "0.5.1",
"node-cron": "^1.2.1",
"node-vibrant": "^3.0.0",
"npm-run-all": "^4.1.2",
"npx": "^9.7.1",
"os-name": "^2.0.1",
"popper.js": "^1.14.3",
"postcss-custom-properties": "6.2.0",
"postcss-loader": "2.0.6",
"postcss-url": "7.1.2",
"protractor": "5.1.2",
"raw-loader": "0.5.1",
"replace": "^0.3.0",
"rimraf": "^2.6.2",
"rxjs": "5.5.2",
"sass-loader": "6.0.6",
"script-loader": "0.7.1",
"source-map-loader": "0.2.1",
"style-loader": "0.18.2",
"stylus-loader": "3.0.1",
"ts-node": "3.3.0",
"tslint": "5.7.0",
"typescript": "2.6.2",
"uglifyjs-webpack-plugin": "1.0.0",
"url-loader": "0.6.2",
"wait-on": "^2.1.0",
"webdriver-manager": "12.0.6",
"webpack": "3.8.1",
"webpack-concat-plugin": "1.4.0",
"webpack-dev-server": "2.9.3",
"zone.js": "0.8.17"
},
"files": [
"*.js",
"build",
"node_modules"
],
"engines": {
"node": "10.15.0"
}
}
electron-builder.json:
{
"productName": "[Project name]",
"appId": "[ID]",
"directories": {
"app": "dist",
"output": "app-builds"
},
"win": {
"icon": "dist/favicon",
"target": [
"squirrel"
]
},
"mac": {
"icon": "dist/favicon",
"target": [
"dmg"
]
},
"linux": {
"icon": "dist",
"target": [
"AppImage"
]
}
}
What I have done so far:
Windows 10:
Installed Node 10.15.0 and NPM 6.4.1
node-gyp 3.8.0
windows-build-tools
Can you please suggest any solution to run the app? Thanks in advance.
Error debug log - screencapture
Related
I have cloned a nestJs project which has the package.json file as below :
###package.json :
{
"name": "customer-portal-api-server",
"version": "0.0.1",
"description": "",
"author": "",
"private": true,
"license": "UNLICENSED",
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"prepare": "husky install",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json",
"migrate:dev": "dotenv -e .development.env -- npx prisma migrate dev",
"seed-run:dev": "dotenv -e .development.env -- npx prisma db seed",
"prisma-studio:dev": "dotenv -e .development.env -- npx prisma studio"
},
"dependencies": {
"#fastify/static": "^6.8.0",
"#nestjs/common": "^9.0.0",
"#nestjs/config": "^2.2.0",
"#nestjs/core": "^9.0.0",
"#nestjs/jwt": "^9.0.0",
"#nestjs/passport": "^9.0.0",
"#nestjs/platform-express": "^9.0.0",
"#nestjs/platform-fastify": "^9.1.4",
"#nestjs/swagger": "^6.2.1",
"#prisma/client": "^4.10.1",
"bcrypt": "^5.1.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"fastify": "^4.12.0",
"joi": "^17.7.0",
"moment": "^2.29.4",
"passport": "^0.6.0",
"passport-jwt": "^4.0.1",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0"
},
"devDependencies": {
"#nestjs/cli": "^9.0.0",
"#nestjs/schematics": "^9.0.0",
"#nestjs/testing": "^9.0.0",
"#types/express": "^4.17.13",
"#types/jest": "27.5.0",
"#types/node": "^16.0.0",
"#types/supertest": "^2.0.11",
"#typescript-eslint/eslint-plugin": "^5.0.0",
"#typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^8.0.3",
"jest": "28.0.3",
"prettier": "^2.3.2",
"prisma": "^4.10.0",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "28.0.1",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.0.0",
"typescript": "^4.3.5"
},
"jest": {
"moduleFileExtensions": [
"js",
"json",
"ts"
],
"rootDir": "src",
"testRegex": ".*\\.spec\\.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"collectCoverageFrom": [
"**/*.(t|j)s"
],
"coverageDirectory": "../coverage",
"testEnvironment": "node"
},
"prisma": {
"seed": "ts-node prisma/seeders/seed_data.ts"
}
}
When i try to install node_modules using the npm i command .
Initially It showed the husky not available error . So I installed the husky using the below command :
export PATH="./node_modules/.bin:$PATH"
After the command **husky got installed ** . But bcrypt package shows the below error :
kathishkumaran#kathish-Latitude-3420:~/Documents/projects$ npm i
npm ERR! code 1
npm ERR! path /home/kathishkumaran/Documents/project/node_modules/bcrypt
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/bin/node /
npm ERR! A complete log of this run can be found in:
npm ERR! /home/kathishkumaran/.npm/_logs/2023-02-15T17_35_42_847Z-debug-0.log
.
.
.
So I try to copy the project and pasted in another directory and did the same as i mentioned above.
But bcrypt package is get installed sucessfully and run as expected as below :
kathishkumaran#kathish-Latitude-3420:~/Desktop/server-api$ npm i
> xxx#0.0.1 prepare
> husky install
husky - Git hooks installed
removed 888 packages, changed 1 package, and audited 871 packages in 4s
97 packages are looking for funding
run `npm fund` for details
2 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
NOTE:
In Both directories the versions are same as below :
xxx$ node -v
v18.14.0
xxx$ npm -v
9.3.1
xxx$ nvm -v
0.39.1
xxx$
So someone help me to fix this issue in my linux system.
I have a node js project running in node v14.17.2 and it time to upgrade i thought v18.13.0
and im really afraid that something will break on the server once i change the version
to run it localy i needed to change npm istanll to npm install --legacy-peer-deps
and then to do :
npm install node-sass --legacy-peer-deps
npm rebuild node-sass
npm audit fix --legacy-peer-deps
so if ill add these steps my app should be fine? is there any other things i need to do befor upgrading the version?
pre-upgraded pacakge.json:
{
"name": "react-app",
"version": "1.1.8",
"private": true,
"dependencies": {
"#date-io/moment": "1.3.13",
"#material-ui/core": "3.0.2",
"#material-ui/icons": "3.0.1",
"#nivo/core": "^0.73.0",
"#nivo/pie": "^0.73.0",
"auth0-lock": "11.30.2",
"autosuggest-highlight": "3.1.1",
"axios": "0.21.1",
"axios-mock-adapter": "1.19.0",
"chart.js": "^2.7.2",
"classnames": "^2.3.1",
"core-js": "^3.14.0",
"downshift": "6.1.3",
"formsy-react": "2.2.5",
"jodit-react": "^1.1.1",
"jss": "^9.8.7",
"jss-extend": "6.2.0",
"jss-rtl": "^0.3.0",
"jwt-decode": "3.1.2",
"keycode": "2.2.0",
"lodash": "4.17.21",
"material-ui-pickers": "^2.2.4",
"mobile-detect": "1.4.5",
"moment": "^2.29.1",
"node-sass": "^4.14.1",
"path-to-regexp": "6.2.0",
"perfect-scrollbar": "1.4.0",
"postcss": "^8.3.5",
"prismjs": "1.23.0",
"prop-types": "^15.7.2",
"qs": "6.10.1",
"raw-loader": "4.0.2",
"react": "17.0.2",
"react-autosuggest": "10.1.0",
"react-big-calendar": "0.33.5",
"react-chartjs-2": "2.7.4",
"react-cookie": "^4.0.3",
"react-credit-cards": "^0.8.3",
"react-dnd": "14.0.2",
"react-dnd-html5-backend": "14.0.0",
"react-dom": "17.0.2",
"react-facebook-pixel": "^1.0.4",
"react-google-charts": "^3.0.15",
"react-gtm-module": "^2.0.11",
"react-jss": "^8.6.1",
"react-number-format": "4.6.3",
"react-popper": "2.2.5",
"react-redux": "7.2.4",
"react-rnd": "^10.3.7",
"react-router-config": "5.1.1",
"react-router-dom": "4.3.1",
"react-scripts": "^2.1.1",
"react-select": "4.3.1",
"react-signature-canvas": "^1.0.6",
"react-swipeable-views": "0.14.0",
"react-table": "^6.8.6",
"react-text-mask": "5.4.3",
"react-to-print": "^2.14.0",
"redux": "4.1.0",
"redux-thunk": "2.3.0",
"typeface-roboto": "1.1.13",
"velocity-react": "1.4.3",
"yarn": "^1.22.10"
},
"scripts": {
"prebuild": "python ../prebuild.py src/myConstants.js",
"start": "yarn run build-css-helpers && cross-env PORT=3001 react-scripts start",
"build": "yarn run build-css-helpers && cross-env NODE_PATH=src react-scripts --max_old_space_size=4096 build",
"build-css-helpers": "./node_modules/.bin/tailwind build ./src/styles/fuse-helpers.tailwind.css -c ./tailwind.js -o ./src/styles/fuse-helpers.css && postcss --use autoprefixer -o ./src/styles/fuse-helpers.css ./src/styles/fuse-helpers.css",
"test": "cross-env NODE_PATH=src react-scripts test --env=jsdom",
"eject": "cross-env NODE_PATH=src react-scripts eject",
"build-docs": "babel-node src/main/content/components/material-ui/build.js",
"postbuild": "python postbuild.py"
},
"devDependencies": {
"#babel/core": "7.14.6",
"#babel/preset-env": "7.14.5",
"autoprefixer": "9.1.5",
"cross-env": "7.0.3",
"js-beautify": "1.14.0",
"marked": "2.1.1",
"postcss-cli": "8.3.1",
"tailwindcss": "0.6.5"
},
"engines": {
"node": ">=14.17.0",
"npm": ">=6.0.0"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
i know i have pacakges to upgrqade i want to start just with node
I am facing some errors during refactoring an old project. also, this project is upgraded from laravel 5.8 to 6.0 laravel. but most likely it is failing during npm run prod. I wonder what is happening. just before the upgrade it was fine.
[webpack-cli] Error: Unknown option '--no-progress'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # production: `cross-env NODE_ENV=production node_modules/webpack/bin/w ebpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/w ebpack.config.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # production script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2021-05-27T12_01_52_782Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # prod: `npm run production`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # prod script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ubuntu/.npm/_logs/2021-05-27T12_01_52_797Z-debug.log
so my package .json will look like this:
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"resolutions": {
"minimist": "^1.2.5"
},
"dependencies": {
"#expo/vector-icons": "^10.2.1",
"#fortawesome/fontawesome-svg-core": "^1.2.35",
"#fortawesome/free-solid-svg-icons": "^5.15.3",
"#fortawesome/react-fontawesome": "^0.1.14",
"#material-ui/core": "^4.11.4",
"#material-ui/icons": "^4.11.2",
"#material-ui/lab": "^4.0.0-alpha.58",
"#mdi/font": "^4.9.95",
"#react-pdf/renderer": "^1.6.16",
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.3.2",
"#testing-library/user-event": "^7.1.2",
"#trendmicro/react-sidenav": "^0.5.0",
"#vue/cli": "^4.5.13",
"braces": "^2.3.2",
"canvasjs": "^1.8.3",
"core-js": "^2.6.12",
"crypto-js": "^4.0.0",
"express": "^4.17.1",
"firebase": "^8.6.2",
"font-awesome": "^4.7.0",
"fs": "0.0.1-security",
"jquery": "^3.6.0",
"lodash": "^4.17.21",
"material-design-icons-iconfont": "^5.0.1",
"material-ui": "^0.20.2",
"material-ui-icons": "^1.0.0-beta.36",
"material-ui-password-field": "^2.1.2",
"mdbvue": "^6.7.2",
"module": "^1.2.5",
"msg91": "0.0.6",
"node-sass": "^4.14.1",
"pondjs": "^0.9.0",
"pug-plain-loader": "^1.1.0",
"react-circular-progressbar": "^2.0.4",
"react-custom-radio": "^1.0.7",
"react-feather": "^2.0.9",
"react-google-charts": "^3.0.15",
"react-move": "^6.4.0",
"react-native-vector-icons": "^6.7.0",
"react-pdf": "^4.2.0",
"react-progressbar": "^15.4.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.3",
"react-signature-canvas": "^1.0.3",
"react-simple-dropdown": "^3.2.3",
"react-timeseries-charts": "^0.16.1",
"react-toastify": "^5.5.0",
"react-vis": "^1.11.7",
"recharts": "^2.0.9",
"styled-components": "^5.3.0",
"vue": "^2.6.12",
"vue-awesome-swiper": "^4.1.1",
"vue-axios": "^2.1.5",
"vue-chartist": "^2.3.1",
"vue-ckeditor2": "^2.1.5",
"vue-click-outside": "^1.1.0",
"vue-custom-scrollbar": "^1.4.0",
"vue-easy-slider": "^5.3.4",
"vue-event-hub": "^1.0.3",
"vue-kanban": "^1.8.0",
"vue-loader": "^16.2.0",
"vue-picture-input": "^2.1.6",
"vue-plyr": "^5.1.3",
"vue-resizable": "^1.3.0",
"vue-router": "^3.5.1",
"vue-smooth-dnd": "^0.8.0",
"vue-split-panel": "^1.0.4",
"vue-template-compiler": "^2.6.12",
"vue-video": "^0.1.7",
"vue2-editor": "^2.10.2",
"vueditor": "^0.3.1",
"vuescroll": "^4.17.3",
"vuetify-media-player": "^0.8.1",
"vuex": "^3.6.2",
"watch": "^1.0.2",
"write-json-file": "^4.3.0"
},
"devDependencies": {
"#babel/plugin-proposal-class-properties": "^7.13.0",
"#babel/preset-react": "^7.13.13",
"#fortawesome/fontawesome-free": "^5.15.3",
"#vue/cli-plugin-babel": "^3.11.0",
"#vue/cli-plugin-eslint": "^4.5.13",
"#vue/cli-service": "^4.5.13",
"axios": "^0.21.1",
"babel-eslint": "^10.1.0",
"cross-env": "^5.2.1",
"eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0",
"laravel-mix": "^6.0.19",
"minimist": "^1.2.5",
"pug": "^3.0.2",
"pug-loader": "^2.4.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"resolve-url-loader": "^4.0.0",
"sass": "^1.34.0",
"sass-loader": "^7.1.0",
"stylus": "^0.54.8",
"stylus-loader": "^3.0.2",
"vue-cli-plugin-vuetify": "^0.6.3",
"vuetify": "^2.5.1",
"vuetify-loader": "^1.7.2",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {
"no-mixed-spaces-and-tabs": 0,
"no-irregular-whitespace": 0
},
"parserOptions": {
"parser": "babel-eslint"
}
},
"postcss": {
"plugins": {
"autoprefixer": []
}
},
"browserslist": [
"> 1%",
"last 2 versions"
],
"description": "## Project setup ``` npm install ```",
"main": "babel.config.js",
"keywords": [],
"author": "",
"license": "ISC"
}
my webpack.mix.js
const mix = require('laravel-mix');
mix.webpackConfig({
module: {
rules: [{
test: /\.pug$/,
oneOf: [{
resourceQuery: /^\?vue/,
use: ['pug-plain-loader']
},
{
use: ['raw-loader', 'pug-plain-loader']
},
{
// Exclude `js` files to keep "css" loader working as it injects
// it's runtime that would otherwise processed through "file" loader.
// Also exclude `html` and `json` extensions so they get processed
// by webpacks internal loaders.
exclude: [/\.js$/, /\.html$/, /\.json$/, /\.ejs$/],
loader: require.resolve('file-loader'),
options: {
name: 'static/media/[name].[hash:8].[ext]',
}
}
]
}]
}
});
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
|
*/
mix.react('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
thanks in advance
looking for some valuable suggestions
I'm trying to use the bcrypt-package inside a vue-electron project, but there is an N-api version issue when I try to run it:
Uncaught Error: The N-API version of this Node instance is 1. This module supports N-API version(s) 3. This Node instance cannot run this module.
I'm running node 12.16.1.
I read up on the documentation about N-API, and according to that version matrix, it is not possible I have version 1 installed. But I can't find any further documentation on how to install/configure/manage these N-API versions.
My package.json:
{
"version": "0.0.1",
"license": null,
"engines": {
"node": "12.16.x"
},
"main": "./dist/electron/main.js",
"scripts": {
"build": "node .electron-vue/build.js && electron-builder",
"build:dir": "node .electron-vue/build.js && electron-builder --dir",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
"dev": "node .electron-vue/dev-runner.js",
"pack": "npm run pack:main && npm run pack:renderer",
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
"postinstall": ""
},
"build": {
"directories": {
"output": "build"
},
"files": [
"dist/electron/**/*"
],
"dmg": {
"contents": [
{
"x": 410,
"y": 150,
"type": "link",
"path": "/Applications"
},
{
"x": 130,
"y": 150,
"type": "file"
}
]
},
"mac": {
"icon": "build/icons/icon.icns"
},
"win": {
"icon": "build/icons/icon.ico"
},
"linux": {
"icon": "build/icons"
}
},
"dependencies": {
"#fortawesome/fontawesome-svg-core": "^1.2.27",
"#fortawesome/free-solid-svg-icons": "^5.12.1",
"#fortawesome/vue-fontawesome": "^0.1.9",
"axios": "^0.18.0",
"bcrypt": "^4.0.1",
"bootstrap": "^4.4.1",
"bootstrap-vue": "^2.7.0",
"dotenv": "^8.2.0",
"dotenv-webpack": "^1.7.0",
"mongoose": "^5.9.4",
"mongoose-uuid2": "^2.3.0",
"portal-vue": "^2.1.7",
"uuid": "^7.0.2",
"vue": "^2.5.16",
"vue-electron": "^1.0.6",
"vue-i18n": "^8.15.5",
"vue-router": "^3.0.1",
"vuex": "^3.0.1",
"vuex-electron": "^1.0.0"
},
"devDependencies": {
"ajv": "^6.5.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-minify-webpack-plugin": "^0.3.1",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-stage-0": "^6.24.1",
"babel-register": "^6.26.0",
"cfonts": "^2.1.2",
"chalk": "^2.4.1",
"copy-webpack-plugin": "^4.5.1",
"cross-env": "^5.1.6",
"css-loader": "^0.28.11",
"del": "^3.0.0",
"devtron": "^1.4.0",
"electron": "^2.0.4",
"electron-builder": "^20.19.2",
"electron-debug": "^1.5.0",
"electron-devtools-installer": "^2.2.4",
"file-loader": "^1.1.11",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "0.4.0",
"multispinner": "^0.2.1",
"node-loader": "^0.6.0",
"style-loader": "^0.21.0",
"url-loader": "^1.0.1",
"vue-html-loader": "^1.2.4",
"vue-loader": "^15.2.4",
"vue-style-loader": "^4.1.0",
"vue-template-compiler": "^2.5.16",
"webpack": "^4.15.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4",
"webpack-hot-middleware": "^2.22.2",
"webpack-merge": "^4.1.3"
}
}
Complete console stacktrace:
Uncaught Error: The N-API version of this Node instance is 1. This module supports N-API version(s) 3. This Node instance cannot run this module.
at Object.module.exports.validate_package_json (/home/fabian/projects/prelude-pos/node_modules/node-pre-gyp/lib/util/napi.js:82:9)
at Object.validate_config (/home/fabian/projects/prelude-pos/node_modules/node-pre-gyp/lib/util/versioning.js:229:10)
at Object.exports.find (/home/fabian/projects/prelude-pos/node_modules/node-pre-gyp/lib/pre-binding.js:21:15)
at Object.<anonymous> (/home/fabian/projects/prelude-pos/node_modules/bcrypt/bcrypt.js:5:27)
at Object.<anonymous> (/home/fabian/projects/prelude-pos/node_modules/bcrypt/bcrypt.js:238:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)
at eval (webpack-internal:///bcrypt:1:18)
at Object.bcrypt (http://localhost:9080/renderer.js:2844:1)
at __webpack_require__ (http://localhost:9080/renderer.js:727:30)
at fn (http://localhost:9080/renderer.js:102:20)
So far, I wiped and reinstalled nodejs, cleared the node_modules and reinstalled all the packages, but no difference there.
So I found an answer to my own question in the end:
Electron comes bundled with its own version of nodejs apparently. Updating electron fixed my error.
My bf and I were making a haiku checker during school today. Everything was working fine but when I cloned his repo i'm getting a "npm ERR! missing script: build;" on my windows 10 PC
Any help will be much appreciated and I can provide more info
Additional errors
npm ERR! Haiku#1.0.0 start: `npm run build; webpack-dev-server --open --mode development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Haiku#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Here is my package.json
{
"name": "Haiku",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "karma start karma.conf.js",
"build": "webpack --mode development",
"start": "npm run build; webpack-dev-server --open --mode development",
"lint": "eslint src/*.js --fix"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.3",
"babel-preset-es2015": "^6.24.1",
"clean-webpack-plugin": "^0.1.18",
"css-loader": "^0.28.10",
"eslint": "^4.18.2",
"eslint-loader": "^2.0.0",
"html-webpack-plugin": "^3.0.6",
"jasmine": "^3.1.0",
"jasmine-core": "^2.99.0",
"karma": "^2.0.0",
"karma-chrome-launcher": "^2.2.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-jquery": "^0.2.2",
"karma-webpack": "^2.0.13",
"style-loader": "^0.20.2",
"uglifyjs-webpack-plugin": "^1.2.2",
"webpack": "^4.0.1",
"webpack-cli": "^2.0.9",
"webpack-dev-server": "^3.1.0"
},
"dependencies": {
"bootstrap": "^4.0.0",
"jquery": "^3.3.1",
"popper.js": "^1.14.1",
"syllable": "^3.0.0"
}
}