Comments (26)
Deployed, since it is not a generic solution, publised a temp module
electerm/electerm@c064b6a
electerm@52446ec
from trzsz.js.
I figured it out. There is a .git
in my home directory, which leads to no .git
in ~/.npm/_cacache/tmp/git-clonevhihTl
.
from trzsz.js.
I tried, not working some how, have to use runtime require
The reason is the code runs before window.require
is set.
Lines 25 to 34 in 9320e1c
Try move window.require = require;
to another source file, and import it before import { TrzszFilter } from "trzsz";
.
And add window.require.resolve = (name) => name;
after window.require = require;
.
from trzsz.js.
Try to use the absolute path of Downloads
?
from trzsz.js.
Oh, do you change it to browser mode? Chrome does not allow writing to system directories. The Downloads
is one of the system directories. Try to make a subdirectory in Downloads
, and save to that subdirectory should work.
from trzsz.js.
Using trzsz in the browser is very limited, and the user experience will be poor. It would be much better if there is a way to provide fs
api to trzsz.
from trzsz.js.
Oh, do you change it to browser mode? Chrome does not allow writing to system directories. The
Downloads
is one of the system directories. Try to make a subdirectory inDownloads
, and save to that subdirectory should work.
Tried different folder, same result, since in newer electron, can not expose fs directly in preload.js, wondering if we can expose fs api in brower mode through ipc, I am doing some experiments.
from trzsz.js.
trzsz just need a few functions in fs
. check https://github.com/trzsz/trzsz.js/blob/main/src/nodefs.ts. I want to change all of them to async, and make it replaceable.
from trzsz.js.
Tried different folder, same result.
Maybe some error in window.showDirectoryPicker
with mode readwrite
.
Line 188 in 9320e1c
from trzsz.js.
I tried, after provide all fs/path functions in ipc mode and provide a proper window.require function, it would work, just need replace fs.
to a runtime require('fs')
.
from trzsz.js.
I tried, after provide all fs/path functions in ipc mode and provide a proper window.require function, it would work, just need replace
fs.
to a runtimerequire('fs')
.
Try this:
window.require = (module) => {
if (module == "fs") {
return {}
}
}
from trzsz.js.
Since you set window.require
to a function, you should be able to use trzsz.js
directly, no need to make a copy.
from trzsz.js.
Since you set
window.require
to a function, you should be able to usetrzsz.js
directly, no need to make a copy.
I tried, not working some how, have to use runtime require
from trzsz.js.
electerm npm install
fails for me.
~/workspace/electerm$ npm i
npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /opt/homebrew/Cellar/node/20.5.1/bin/node /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/lonnywong/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > [email protected] prepare
npm ERR! > husky install
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm ERR! .git can't be found (see https://git.io/Jc3F9)
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /Users/lonnywong/.npm/_cacache/tmp/git-clonevhihTl
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c husky install
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in: /Users/lonnywong/.npm/_logs/2023-08-29T07_30_41_496Z-debug-0.log
from trzsz.js.
electerm
npm install
fails for me.~/workspace/electerm$ npm i npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates. npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. npm ERR! code 1 npm ERR! git dep preparation failed npm ERR! command /opt/homebrew/Cellar/node/20.5.1/bin/node /opt/homebrew/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/Users/lonnywong/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run npm ERR! > [email protected] prepare npm ERR! > husky install npm ERR! npm WARN using --force Recommended protections disabled. npm ERR! npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm ERR! .git can't be found (see https://git.io/Jc3F9) npm ERR! npm ERR! code 1 npm ERR! npm ERR! path /Users/lonnywong/.npm/_cacache/tmp/git-clonevhihTl npm ERR! npm ERR! command failed npm ERR! npm ERR! command sh -c husky install npm ERR! npm ERR! npm ERR! A complete log of this run can be found in: /Users/lonnywong/.npm/_logs/2023-08-29T07_30_41_496Z-debug-0.log
nodejs 16?
from trzsz.js.
Both 16 and 20 are the same error.
Haven't found a solution that works for me yet.
from trzsz.js.
Can you try uninstall your nodejs, install with nvm, then nvm install 16
from trzsz.js.
brew uninstall node
brew install node@16
export PATH="/opt/homebrew/opt/node@16/bin:$PATH"
node -v
v16.20.2
npm -v
8.19.4
Same error for me.
from trzsz.js.
I mean use nvm
brew uninstall node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
nvm install 16
Also, could try npm cache clean --force
from trzsz.js.
brew uninstall --force node
brew uninstall --force node@16
brew install nvm
mkdir ~/.nvm
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
nvm install 16
npm cache clean --force
node -v
v16.20.2
npm -v
8.19.4
npm i
Same error.
from trzsz.js.
did you clone the electem repo or download as https?
gpt4 gives this:
The error message indicates that there's an issue with Husky, a tool used for managing git hooks. The error message .git can't be found suggests that Husky is unable to find the .git directory in your project.
Here are some things you can try:
Ensure you're in a Git repository: Husky requires your project to be a Git repository. You can initialize it as a Git repository by running git init in the root of your project if it's not already one.
Try reinstalling Node modules: Sometimes, deleting node_modules and reinstalling can help resolve issues related to dependencies:
bash
rm -rf node_modules
npm install
Try updating Husky: It's possible that the version of Husky being used is outdated or has known issues. Try updating it:
bash
npm uninstall husky
npm install --save-dev husky@latest
Manually run husky install: Try manually running the command that seems to be causing the error:
bash
npx husky install
Check global npm cache: There might be some corruption or issues with your global npm cache, you could try clearing it with npm cache clean --force.
Check Node and npm versions: Ensure you're using up-to-date versions of Node.js and npm, as older versions may have compatibility issues with current packages.
If none of these suggestions work, please provide additional information about your development environment such as operating system, Node.js version, npm version etc., so I could provide more specific advice.
from trzsz.js.
git clone https://github.com/electerm/electerm.git
from trzsz.js.
Check that your version of Git, is it greater than 2.9?
from trzsz.js.
git version 2.39.2 (Apple Git-143)
from trzsz.js.
Maybe related to apple m1.
from trzsz.js.
I tried, not working some how, have to use runtime require
The reason is the code runs before
window.require
is set.Lines 25 to 34 in 9320e1c
Try move
window.require = require;
to another source file, and import it beforeimport { TrzszFilter } from "trzsz";
.And add
window.require.resolve = (name) => name;
afterwindow.require = require;
.
Works!
from trzsz.js.
Related Issues (11)
- [feature request] Support rz/sz HOT 1
- 不支持safari 14 版本 HOT 2
- chooseSaveDirectory is not a function HOT 3
- node12 is not supported? HOT 3
- try/catch is invalid HOT 5
- Does electron enable drag-and-drop uploads HOT 28
- Add trzsz support to ttyd HOT 1
- 大佬问个问题 The browser doesn't support the File System Access API HOT 40
- fs.exists deprecated, should use fs.stat() or fs.access() instead. HOT 2
- Make timeout configurable HOT 27
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trzsz.js.