I wrote my first node.js app, but it can\'t find express library:
C:\\ChatServer\\Server>node server.js
module.js:340
throw err;
^
Error: C
On Ubuntu-based OS you can try
sudo apt-get install node-express
its working for me on Mint
installing express globally will not work on your local project so you need to install it locally for use .
npm install express
Hope this will work
Thank you
I had this error in vscode, although the modules where installed. I am using typescript and express. In the server.ts
files all the imports had red squiggly underlines. It turns out I had a faulty tsconfig.json
file.
{
"compileOnSave": false,
"compilerOptions": {
"module": "commonjs", // Previously this value was `es6`
"target": "es6",
"allowSyntheticDefaultImports": true,
"baseUrl": "public",
"sourceMap": true,
"outDir": "dist",
"jsx": "react",
"strict": true,
"preserveConstEnums": true,
"removeComments": true,
"noImplicitAny": true,
"allowJs": true
},
"exclude": [
"node_modules",
"build"
]
}