-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SyntaxError: The requested module 'ocpp-eliftech' does not provide an export named 'OCPPServer' #8
Comments
hi |
Try this import { CentralSystem, OCPPCommands } from 'ocpp-eliftech';
const server = new CentralSystem();
server.listen(9220); |
i try this but get this error SyntaxError: The requested module 'ocpp-eliftech' does not provide an export named 'OCPPCommands' |
Hi @psnehanshu , I am facing the same issue for "OCPPCommands" and shows me error SyntaxError: The requested module 'ocpp-eliftech' does not provide an export named 'OCPPCommands' So, can you please provide me the solution for it? |
I wrote a small project using this package but got this error instead
Hence I installed it using But then it worked. Check the attached zip file. Also do notice that I have put I will also like to plug my own package here, which you can give a try. https://github.com/pSnehanshu/ocpp-task-manager |
Hi @psnehanshu, I have downloaded "ocpp-eliftech.zip" and extract and tried to run on my end as below: on package.json file I have added "start": "node index.js", under "scripts" object and run with command "npm start". But still facing the same issue and show me error: Can you please point out to me why it is showing above error to me? |
What is your node version? Can you try with v16? |
Hi @psnehanshu , |
Hi @psnehanshu, If we want to communicate with OCPP system in real world, then do we need to implement both server and client on our end? Or do we need to just implement OCPP client only? Here, I am little bit confused because on some packages it is mentioned the server URL to config at client side like "http://localhost:9220/webServices/ocpp/CP1111" and on some packages it is mentioned as "ws://localhost:8080/ocpp/1.6J" Because I have tried to run ocpp client, but not working on my end. Thanks, |
@kvext Depends on if you are trying to build a charger or a backend system. Read my article and see if it helps. https://www.snehanshu.com/electric-vehicles/ocpp/2020/04/03/what-is-ocpp.html |
Hi @psnehanshu, |
You will have to create an OCPP server. It will listen for websocket connections. It can receive commands from charger as well as send commands to the charger. I will suggest you read the official documentation for a better understanding. |
Hi @psnehanshu, I am trying to create OCPP server and client using https://www.npmjs.com/package/ocpp-rpc
On Client app, I have already define method as below:
But, Same thing is working only if I will create both server and client objects on the same file as per last example. So, Any idea why it is not working if I want to call methods with separate files? Thanks, |
You should ask the creator of that library. |
Hi,
I have installed the OCPP module using "npm install --save ocpp-eliftech" and use the OCPP Server example in our index.js file as shown below :
import { OCPPServer, OCPPCommands } from 'ocpp-eliftech';
const server = new OCPPServer();
server.listen(9220);
server.onRequest = async function(command) {
// Handle different commands
if (command instanceof OCPPCommands.BootNotification) {
return {
status: 'Accepted',
currentTime: new Date().toISOString(),
interval: 60
};
}
}
When we run
npm start
then got error "SyntaxError: The requested module 'ocpp-eliftech' does not provide an export named 'OCPPServer'"Please let me know how to solve this issue.
The text was updated successfully, but these errors were encountered: