Comments (8)
Hi @emond07,
thank you for posting your issue. π
According to the error output you posted, you are trying to run the basic example, right?
However, the examples use import/export modules syntax which is not supported in Node.js by default (you need some transpiler, e.g. Babel with appopripate plugins, or you can enable native support (with some limitations) in the newest Node.js versions).
The simplest way to run the example is with npm run example-basic
or yarn example-basic
. As you can see here in the package.json, it is actually an alias for node -r babel-register examples/basic.js
. Requiring babel-register using -r flag, ensures the code is transpiled applying rules from project's root .babelrc.
Hope it helps.
Feel free to contact me, if you encounter any problems or need any help.
PS Don't forget to star βοΈ my library, if you find it useful. π Thanks.
from nfc-pcsc.
Hi @emond07,
any updates on this issue?
Were you able to make it work?
Please let me know so I can close the issue. Thanks. π
from nfc-pcsc.
@emond07 I am closing the issue now. Feel free to reopen it in case you are still facing the issue. π
from nfc-pcsc.
hi,
Im having issues in running the basic.js using NPM
C:\Users\emond\Desktop\nfc\nfc-pcsc>npm run example-basic
[email protected] example-basic C:\Users\emond\Desktop\nfc\nfc-pcsc
node -r @babel/register examples/basic.js
internal/modules/cjs/loader.js:589
throw err;
^
Error: Cannot find module '@babel/register'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
at Function.Module._load (internal/modules/cjs/loader.js:513:25)
at Module.require (internal/modules/cjs/loader.js:643:17)
at Module._preloadModules (internal/modules/cjs/loader.js:828:12)
at preloadModules (internal/bootstrap/node.js:733:7)
at startup (internal/bootstrap/node.js:298:9)
at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] example-basic: node -r @babel/register examples/basic.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] example-basic script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\emond\AppData\Roaming\npm-cache_logs\2019-01-05T00_31_28_240Z-debug.log
C:\Users\emond\Desktop\nfc\nfc-pcsc>
from nfc-pcsc.
Hi @emond07,
it seems that you had not installed the dependencies before you ran the example.
Try to install the dependencies with npm install
first and then run npm run example-basic
.
For more info, see Running examples locally section of the README.
Hope it helps. π
PS Don't forget to star βοΈmy library, if you find it useful. πThanks.
from nfc-pcsc.
it now working.. thanks for the help
from nfc-pcsc.
@emond07 You're welcome! π
Enjoy using the nfc-pcsc library and don't forget to star βοΈit, if you find it useful. πThanks.
from nfc-pcsc.
I get this error
SyntaxError: Unexpected token <
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
from nfc-pcsc.
Related Issues (20)
- Constructing APDU command on NTAG21x
- Error when writing data. Receives an Invalid data length error. HOT 3
- Authentication failed for same blocks BUT is Working in others HOT 1
- P2P Feature
- Empty Data
- Multi RFID Reader
- was compiled against a different Node.js version using NODE_MODULE_VERSION 111. This version of Node.js requires NODE_MODULE_VERSION 110. HOT 3
- UnhandledPromiseRejectionWarning: WriteError: Write operation failed: Status code: 0x6300 HOT 3
- I don't understand that code HOT 1
- Module not found: Error: Can't resolve 'fs' HOT 2
- Unable to run the basic example HOT 2
- Add disposition parameter in disconnect method
- MacOS installation issue using npm HOT 2
- Cannot access "events.EventEmitter" in client code HOT 4
- Context Aware Native Module, Electron Context Isolation and Node Integration Support
- Unsupported engine Please Help
- Emulate Tag NFC?
- Sveltekit build fails when running 'npm run build' but works on 'npm run dev' HOT 1
- It turned out to connect the library in CRA(React)? HOT 1
- Writes become slower each time
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 nfc-pcsc.