Comments (6)
Hello. I'm trying to get data from an S7 PLC using your library. As a result, I get the following errors:
import {S7Client} from 'napi-snap7';
- "Cannot resolve symbol 'S7Client'",const res = client.ConnectTo("192.168.172.2", 0, 1);
- "Unresolved function or method ConnectTo()",client.ReadArea(0x84, 42, 0, 4, 0x02, (err, data)
- "Unresolved function or method ReadArea()",if (err) return console.log(client.ErrorText(err));
- "Unresolved function or method ErrorText()" and so on. What could be the reason?
Hi
This is a CommonJS module system, import statements are used in ES6 or ECMAScript module system to include modules. Therefore you must import the module using require as shown in the examples folder.
from napi-snap7.
This is what I did initially. But the result is the same:
const snap7 = require('napi-snap7');
- TS80001: File is a CommonJS module; it may be converted to an ES module.
const client = new snap7.S7Client();
- Unresolved type S7Client
from napi-snap7.
This is what I did initially. But the result is the same:
const snap7 = require('napi-snap7');
- TS80001: File is a CommonJS module; it may be converted to an ES module.const client = new snap7.S7Client();
- Unresolved type S7Client
I ran the code you can find in the async_S7.js file and it works fine. I did it on my laptop running the ubuntu 22.04 OS, node v20.9.0 installed on it.
Which OS are you using?
@Sinclair81 can you help?
from napi-snap7.
I using OS Ubuntu 22.04, node v20.5.1
from napi-snap7.
Do you have napi-snap7 installed in your project folder?
npm install napi-snap7
from napi-snap7.
Of course. Project folder package.json:
"dependencies": {
"napi-snap7": "^1.2.3",
"prebuildify": "^5.0.1"
}
from napi-snap7.
Related Issues (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 napi-snap7.