Access denied nsis electron builder - node.js

When I package using electron-builder, it shows an error access denied, I came across a post that says it has something to do with the firewall but how will I disable it in windows.
The Error
C:\Users\dell\AppData\Local\electron-builder\Cache\nsis\566152007 C:\Users\dell\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1: Access is denied.
тип ENOENT: no such file or directory, copyfile 'C:\Users\dell\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\elevate.exe' -> 'C:\Users\dell\Desktop\opcoin\download\app\dist\win-unpacked\resources\elevate.exe' failedTask=build stackTrace=Error: ENOENT: no such file or directory, copyfile 'C:\Users\dell\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\elevate.exe' -> 'C:\Users\dell\Desktop\opcoin\download\app\dist\win-unpacked\resources\elevate.exe'
at processImmediate (internal/timers.js:461:21)
From previous event:
at NsisTarget.buildInstaller (C:\Users\dell\Desktop\opcoin\download\app\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:223:29)
at NsisTarget.finishBuild (C:\Users\dell\Desktop\opcoin\download\app\node_modules\app-builder-lib\src\targets\nsis\NsisTarget.ts:129:9)
at async Promise.all (index 1)
at AsyncTaskManager.awaitTasks (C:\Users\dell\Desktop\opcoin\download\app\node_modules\builder-util\src\asyncTaskManager.ts:65:25)
at Packager.doBuild (C:\Users\dell\Desktop\opcoin\download\app\node_modules\app-builder-lib\src\packager.ts:453:5)
at Object.executeFinally (C:\Users\dell\Desktop\opcoin\download\app\node_modules\builder-util\src\promise.ts:12:14)
at Packager._build (C:\Users\dell\Desktop\opcoin\download\app\node_modules\app-builder-lib\src\packager.ts:376:31)
at Packager.build (C:\Users\dell\Desktop\opcoin\download\app\node_modules\app-builder-lib\src\packager.ts:337:12)
at Object.executeFinally (C:\Users\dell\Desktop\opcoin\download\app\node_modules\builder-util\src\promise.ts:12:14)
npm ERR! code ELIFECYCLE
Package.json:
{
"name": "opcoin",
"version": "1.0.0",
"description": "OpCoin Grabber",
"main": "app.js",
"scripts": {
"start": "electron .",
"dist": "electron-builder",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "^14.0.1",
"electron-builder": "^22.11.7"
},
"build": {
"appId": "com.aryaanish.opcoin",
"productName": "Op Coin Grabber",
"target": "NSIS",
"nsis": {
"allowToChangeInstallationDirectory": true,
"oneClick": false
},
"win": {
"icon": "build/icon.ico"
}
}
}
Fix
I restarted my computer and it worked but the correct answer is given by #Casimir Crystal in the comment

Related

Node gets wrong HTML from package.json when executing npm start

I have a package.json file that looks like:
{
"name": "assignment-1",
"version": "1.0.0",
"description": "This is the Git and Node basic learning project",
"main": "aboutus.html",
"scripts": {
"start": "npm run lite",
"test": "echo \"Error: no test specified\" && exit 1",
"lite": "lite-server"
},
"repository": {
"type": "git",
"url": "git+https://path_to_git/first-assignment.git"
},
"author": "",
"license": "ISC",
"homepage": "https://path_to_git/first-assignment#readme",
"devDependencies": {
"lite-server": "^2.2.2"
},
"bugs": {
"url": "https://path_to_git/first-assignment/issues"
},
but when I execute npm start, instead of aboutus.html, the index.html webpage opens.
Any idea what I am doing wrong and I don't get the aboutus.html loading as I want it to?
I think I've found the solution:
The index.html appears as the default page, in localhost:3000. Then I simply need to write localhost:3000/aboutus.html to get to the page I wanted to go... Seems like it was pretty simple after all!

tried to npm link and run the package after but throws an error "no such file"

i did an npm link to my node package for generating password. however, after npm link and it throws these error:
npm WARN saveError ENOENT: no such file or directory, open '/Users/valeryfun/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/valeryfun/package.json'
i've included bin and repository type, but i still cant run the package.
here's the package.json file:
{
"name": "password-generator",
"version": "1.0.0",
"private": true,
"description": "A password generator",
"main": "index.js",
"preferGlobal": true,
"bin": {
"password-generator": "./index.js"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Valery",
"license": "MIT",
"dependencies": {
"chalk": "^4.1.1",
"clipboardy": "^2.3.0",
"commander": "^8.1.0"
},
"repository": {
"type": "git",
"url": "https://github.com/valeryfun/password-generator-lazy.git"
}
}
did i miss out anything such that I couldn't use the package after linking it?

Getting error: "npm ERR! missing script: start", yet start script is there

{
"name": "oculus_scraper_node",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cheerio": "^1.0.0-rc.5",
"nodemailer": "^6.4.17",
"puppeteer": "^5.5.0"
}
}
When using heroku and checking if it deployed properly, I keep getting an error reading "npm ERR! missing script: start", but i definitely have the start script in my program, as you can see. I've looked through a couple other posts but nothing has worked. Any ideas?

Why do I keep getting error trying to run npm scripts?

I am just getting to learn node and webpack. I was following a tutorial, but I keep running into an error. Details of the error and my setup is given below:
error details
log file
My setup
package.json content
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack"
},
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
},
"dependencies": {
"path": "^0.12.7"
}
}

Update Packages.json automatically with the pre-installed moduels in NODEJS

In my local machine, I worked on a node.js app, I had installed many packages before initializing the package.json.
When I initialized the Package.json using:
npm init
I got the package.json but it does not contain all the dependencies that exist in the node_modules,
Which caused me a problem of missing packages when I moved to the production server (I run npm install)
Is there a way to automatically include all of them in the dependencies part.
Here is the JSON file I have:
{
"name": "xxxx",
"version": "1.0.0",
"description": "xxxxxxx",
"main": "server.js",
"dependencies": {
"date-utils": "^1.2.21",
"mssql": "^4.0.4",
"mysql": "^2.11.1",
"seriate": "^0.9.0",
"websocket": "^1.0.23",
"winston": "^2.2.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"repository": {
"type": "git",
"url": "git+https://gitlab.com/odot-web/hefner-socket.git"
},
"keywords": [
"nodejs",
"hefner",
"socket"
],
"author": "xxxx",
"license": "ISC",
"bugs": {
"url": "https://gitlab.com/odot-web/hefner-socket/issues"
},
"homepage": "https://gitlab.com/odot-web/hefner-socket#README"
}

Resources