Unable to "npm install" - npm

Please could I ask for help with the following:
I have cloned the Electron starter app like so:
git clone https://github.com/electron/electron-quick-start
And have it running.
I am working from the terminal window is VSCode.
I am using node version 6.13.4
Can type "npm start" and all is good, app runs fine.
Now, I want to use a certain package for working with zip files, so I try the following:
npm install decompress-zip
The result is ultimately an error, here's the output:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm install decompress-zip
> electron#16.0.5 postinstall C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\electron
> node install.js
RequestError: self signed certificate in certificate chain
at ClientRequest.<anonymous> (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\got\source\request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:428:26)
at ClientRequest.emit (events.js:333:22)
at ClientRequest.origin.emit (C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\#szmarczak\http-timer\source\index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:426:9)
at TLSSocket.emit (events.js:321:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
npm WARN rollback Rolling back debug#2.6.9 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip\node_modules\extract-zip\node_modules'npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#16.0.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#16.0.5 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:\Users\105043131\AppData\Roaming\npm-cache\_logs\2022-01-05T11_15_47_499Z-debug.log
Now the build is broken. If try again "npm start" then I get:
PS C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip> npm
start
electron-quick-start#1.0.0 start C:\Work\Electron Apps\electron-quick-start-added-fs-and-zip
electron .
internal/modules/cjs/loader.js:984 throw err; ^
Error: Cannot find module 'C:\Work\Electron
Apps\electron-quick-start-added-fs-and-zip\node_modules\electron\cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
at Function.Module._load (internal/modules/cjs/loader.js:863:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } npm ERR! code ELIFECYCLE npm
ERR! errno 1 npm ERR! electron-quick-start#1.0.0 start: electron .
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the
electron-quick-start#1.0.0 start 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:\Users\105043131\AppData\Roaming\npm-cache_logs\2022-01-05T11_18_31_473Z-debug.log
Makes no difference now if I run "npm uninstall decompress-zip", I still get the same error when I try "npm start".
This line from the above caught my eye:
npm ERR! Failed at the electron#16.0.5
If I start completely over an try installing another package instead like so:
npm install yauzl
I get similar errors including the line:
npm ERR! Failed at the electron#16.0.5 postinstall script.
I currently have electron 8.1.1 installed
Could it be that these packages require electron 16?
Or is it something else?
If it is the former, would anyone know of a solution for unzipping a disk file using an older version of electron?
Thanks for any help.

the best way is to update Node.js. Uninstall old version then go to https://nodejs.org/en/download/ and download LTC version

Related

I get an error creating a react-360 project

I get this error when I start a new react-360 project using react-360 init myProject.It creates the folder but when I npm start it gives me more errors.
react-360 init MyProject
(node:17583) ExperimentalWarning: The fs.promises API is experimental
Creating new React 360 project...
Project directory created at MyProject
Copying assets...
Installing dependencies...
(node:17584) ExperimentalWarning: The fs.promises API is experimental
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: MyProject#0.0.1
npm ERR! Found: react#16.3.2
npm ERR! node_modules/react
npm ERR! react#"16.3.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"16.3.1" from react-native#0.55.4
npm ERR! node_modules/react-native
npm ERR! react-native#"~0.55.4" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /Users/scylla/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/scylla/.npm/_logs/2021-03-17T10_50_46_670Z-debug.log
`npm` exited with code 1. Try fixing the errors above and run `npm` from within MyProject again.
When I run npm start
npm start
(node:17675) ExperimentalWarning: The fs.promises API is experimental
> MyProject#0.0.1 start
> node node_modules/react-360/scripts/packager.js
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module '/Users/scylla/Documents/cs/react360test/MyProject/node_modules/react-360/scripts/packager.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Any Ideas on how to solve it? Thanks.
ok, I just ran npm install --force and it fixed everything!!

How can I install electronjs on Ubuntu from behind a proxy?

I have tried to install electronjs several times but I have not been able, I am behind a proxy and each attempt has returned the following error
> electron#10.1.5 postinstall /home/dipper/Development/my-electron-app/node_modules/electron
> node install.js
RequestError: getaddrinfo EAI_AGAIN github.com github.com:443
at ClientRequest.request.once.error (/home/dipper/Development/my-electron-app/node_modules/got/source/request-as-event-emitter.js:178:14)
at Object.onceWrapper (events.js:286:20)
at ClientRequest.emit (events.js:203:15)
at ClientRequest.origin.emit.args (/home/dipper/Development/my-electron-app/node_modules/#szmarczak/http-timer/source/index.js:37:11)
at TLSSocket.socketErrorListener (_http_client.js:401:9)
at TLSSocket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm WARN enoent ENOENT: no such file or directory, open '/home/dipper/Development/my-electron-app/package.json'
npm WARN my-electron-app No description
npm WARN my-electron-app No repository field.
npm WARN my-electron-app No README data
npm WARN my-electron-app No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#10.1.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#10.1.5 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! /home/dipper/.npm/_logs/2020-11-10T17_15_33_463Z-debug.log
Try this command:
npx cross-env ELECTRON_GET_USE_PROXY=true GLOBAL_AGENT_HTTPS_PROXY=<your proxy URL> npm install electron
Check this thread for more information and the original source.
I solved the problem by changing the connected wifi network. I shared the mobile data with my computer and "npm i electron" worked.

npm start isn't working, react-native app

im trying to build react-native app.
running the commands on gitBash, windows10.
when im trying to run 'npm start' im getting this error:
Fixed , just installed again expo-cli in the rn-starter folder, thanks for the answers :)
$ npm start
> # start C:\Users\Liran\food
> expo start
'expo-cli' is not recognized as an internal or external command,
operable program or batch file.
This command requires Expo CLI.
Do you want to install it globally [Y/n]? Y
Installing the package 'expo-cli'...
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'
npm ERR! [OperationalError: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink 'C:\Users\Liran\AppData\Roaming\npm\node_modules\expo-cli\node_modules\#expo\.xdl.DELETE\binaries\windows\adb\AdbWinApi.dll'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Liran\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\#expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinApi.dll'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\\Users\\Liran\\AppData\\Roaming\\npm\\node_modules\\expo-cli\\node_modules\\#expo\\.xdl.DELETE\\binaries\\windows\\adb\\AdbWinApi.dll',
npm ERR! parent: 'expo-cli'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Liran\AppData\Roaming\npm-cache\_logs\2020-10-19T09_36_58_255Z-debug.log
Installing Expo CLI failed. You can install it manually with:
npm install --global expo-cli
npm ERR! code ELIFECYCLE
npm ERR! errno 4294963248
npm ERR! # start: `expo start`
npm ERR! Exit status 4294963248
npm ERR!
npm ERR! Failed at the # start 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:\Users\Liran\AppData\Roaming\npm-cache\_logs\2020-10-19T09_36_58_348Z-debug.log
help please someone :)
Open windows terminal as Administrator and run command:
install --global expo-cli
then from the root of your project you can either run expo start or npm start both will do.
You need to install Expo CLI package.
see: https://docs.expo.io/workflow/expo-cli/
install:
npm install -g expo-cli
If you still getting same error do these two steps;
Be sure about working on terminal as administrator
If you're using an antivirus program, STOP it while trying to execute above command.

Failed at the electron#1.8.2 postinstall script

I was trying to install electron into my project, but it is giving an error. I also tried to do this with unsafe-perm, but still giving the same error.
npm install electron --save-dev --save-exact
> electron#1.8.2 postinstall E:\PrgLang\Electron\crypto-app\node_modules\electron
> node install.js
Downloading electron-v1.8.2-win32-x64.zip
[============================================>] 100.0% of 55.21 MB (1.51 MB/s)
E:\PrgLang\Electron\crypto-app\node_modules\electron\install.js:47
throw err
^
Error: Could not parse checksum file at line 1:
at new ChecksumParseError (E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:71:127)
at E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:130:20
at Array.forEach (<anonymous>)
at E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:125:38
at new Promise (<anonymous>)
at ChecksumValidator.parseChecksumFile (E:\PrgLang\Electron\crypto-app\node_modules\sumchecker\build.js:121:14)
at <anonymous>
npm WARN crypto-app#1.0.0 No description
npm WARN crypto-app#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron#1.8.2 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron#1.8.2 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:\Users\Harshit\AppData\Roaming\npm-cache\_logs\2018-02-11T03_33_52_399Z-debug.log
Can you please try(after removing node_modules)
sudo npm install electron --save-dev --save-exact --unsafe-perm=true --allow-root
I was running into the same error and this is what worked for me.
According to this GitHub issue it could potentially be solved with one of the following actions:
remove the node_modules folder and run npm install again
rename the SHASUM file in your user home directory's .electron folder
The postinstall script of Electron is downloading a binary from a non-npm domain (possibly github.com), for which the proxy may not be configured.

GIT Bash, npm start error

i am getting the following error on npm start command,
angular-quickstart#1.0.0 prestart C:\Project\myapp
npm run build
angular-quickstart#1.0.0 build C:\Project\myapp
tsc -p src/
angular-quickstart#1.0.0 start C:\Project\myapp
concurrently "npm run build:watch" "npm run serve"
Error occured when executing command: npm run build:watch
Error: Unable to detect platform shell type. Please set SHELL_EXECUTE_FLAG env variable.
at detectExecuteFlag (C:\Project\myapp\node_modules\spawn-default-shell\src\get-shell.js:29:9)
at getShell (C:\Project\myapp\node_modules\spawn-default-shell\src\get-shell.js:37:18)
at Object.spawn (C:\Project\myapp\node_modules\spawn-default-shell\src\index.js:5:24)
at C:\Project\myapp\node_modules\concurrently\src\main.js:192:34
at arrayMap (C:\Project\myapp\node_modules\lodash\lodash.js:660:23)
at Function.map (C:\Project\myapp\node_modules\lodash\lodash.js:9571:14)
at run (C:\Project\myapp\node_modules\concurrently\src\main.js:181:22)
at main (C:\Project\myapp\node_modules\concurrently\src\main.js:61:5)
at Object. (C:\Project\myapp\node_modules\concurrently\src\main.js:421:1)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:418:7)
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart#1.0.0 start: concurrently "npm run build:watch" "npm run serve"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart#1.0.0 start script 'concurrently "npm run build:watch" "npm run serve"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! concurrently "npm run build:watch" "npm run serve"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Project\myapp\npm-debug.log
Try to update your nodejs refer to these answers:
How do I update node and npm on windows?
If the error still persist use this link:
'concurently' is not recognized as an internal or external command, operable program or batch file