Comments (3)
@sindresorhus has funded $36.00 to this issue.
- Submit pull request via IssueHunt to receive this reward.
- Want to contribute? Chip in to this issue via IssueHunt.
- Checkout the IssueHunt Issue Explorer to see more funded issues.
- Need help from developers? Add your repository on IssueHunt to raise funds.
from clipboardy.
The trick is, native windows binaries need to be on a letter drive to run (e.g. C: drive).
Are you sure about this? I just did some debugging on my WSL 1 instance (I don't have WSL2 for testing) and it works fine with a simple change:
1) Initialize a project like this:
/tmp
❯ mkdir clipboard
mkdir: created directory 'clipboard'
/tmp
❯ cd $_
/tmp/clipboard
❯ npm init --yes
Wrote to /tmp/clipboard/package.json:
{
"name": "clipboard",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
/tmp/clipboard
❯ npm i --save clipboardy
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
+ [email protected]
added 21 packages from 8 contributors and audited 24 packages in 2.721s
found 0 vulnerabilities
2) Add an index.js
file with (for testing purposes):
const clipboardy = require('clipboardy');
clipboardy.writeSync('🦄');
3) Change linux
in node_modules/clipboardy/index.js
line 20 to windows
(this is just for testing purposes, not production code).
4) Execute in your shell:
/tmp/clipboard
❯ node index.js
5) Paste (with Ctrl+V or something) into a Windows application and observe clipboardy
working.
You can also test the pasting action and you'll see it also works just fine, try it.
I was going to tackle this issue on Issue Hunt but the fix feels quite simple and it's basically point 2 in the original post. I'm not the one who deserves it. Unless I'm missing something here? Perhaps this doesn't quite work on WSL 2?
from clipboardy.
@sindresorhus has rewarded $32.40 to @g-rath. See it on IssueHunt
- 💰 Total deposit: $36.00
- 🎉 Repository reward(0%): $0.00
- 🔧 Service fee(10%): $3.60
from clipboardy.
Related Issues (20)
- Doesn't work on Safari 12 - TypeError: undefined is not an object (evaluating 'navigator.clipboard.writeText') HOT 2
- Couldn't find the `xsel` binary and fallback didn't work. HOT 1
- Uncaught Error: spawnSync clipboard_x86_64,exe ENOENT on Windows HOT 2
- Error [ERR_REQUIRE_ESM]: Must use import to load ES Module HOT 3
- Module not found: Error: Can't resolve 'node:process' in 'node_modules/clipboardy' HOT 1
- UncaughtSyntaxError: Unexpected token import HOT 1
- Loading with --experimental-modules HOT 2
- Doesn't works when I launch my app to Heroku HOT 3
- clipboardy do not support require ? HOT 1
- Error [ERR_REQUIRE_ESM]: require() of ES Module E:\~\node_modules\clipboardy\index.js not supported. HOT 3
- Cannot load module in JEST HOT 1
- windows wsl2 is slow with windows fallback binaries HOT 2
- Doesn't work with typescript HOT 4
- Having this error when run in Discord.JS Bot HOT 1
- i tried running clipboard thru heroku and this is the error i encounter HOT 1
- Powershell on Windows HOT 1
- Both xsel and fallback failed HOT 2
- Use Clipboard for Linux, Windows, macOS, and *BSD HOT 2
- Npmjs.org and GitHub 2.3.0 release packages checksum differs HOT 2
- Browser support in http (non-secure context) HOT 2
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 clipboardy.