Reputation: 345
I'm testing a simple NodeJS app in my Raspberry but I can't get it working. I developed and tested in my Windows 10 and it works great, but when I move the files into the Raspberry it says node can't find express module:
EDIT: I've re-upload the image since I mistaken the previous
Data:
- Raspberry Pi Model: 3B V1.2
- OS: Raspbian GNU/Linux 9 (stretch)
- NodeJS: v8.11.3
- NPM: 5.6.0
I've read another questions and try the next steps (without success):
- npm install
- sudo npm install
- npm install express
- sudo npm install express
- npm install express --save
In my node_modules folder it seems to be everything ok:
My folders structure:
Upvotes: 0
Views: 984
Reputation: 1528
It is typo. You are trying to use Express
not express
NodeJS are case sensitive, so you have to make sure that your character are in the same case.
Upvotes: 2
Reputation: 731
It cannot find app.js
... Because there is none in this folder ;)
You're trying to launch your app.js
while cd
d in your node_modules
folder.
The way node modules work is that they'll be installed in a node_modules
folder that you can then access app-wise by either require
ing them (CommonJS) or import
ing them (ESModules).
Here, it seems like you're just in the wrong cd, simple as that.
Upvotes: 0