I have installed NodeJS, added Express on top and now I cant make FabricJS work.
Do I have to follow the steps in https://github.com/kangax/fabric.js/ under "Building" for FabricJS to work?
I tried running $ node build.js in the root of my app which gives me:
$ node build.js
module.js:327
throw err;
^
Error: Cannot find module 'D:\Drive\Personal\Sandbox\express-angular-app\build.j
s'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:134:18)
at node.js:962:3
And also in the fabric module folder which gives me:
$ node build.js
D:\Drive\Personal\Sandbox\express-angular-app\node_modules\fabric\build.js:93
if (err) throw err;
^
Error: ENOENT: no such file or directory, open 'D:\Drive\Personal\Sandbox\expres
s-angular-app\node_modules\fabric\HEADER.js'
at Error (native)
I use Jade and I have the following in my index.jade and fabric.js:
index.jade and fabric.js
The problem was that I confused back-end vs front-end. I was expecting the code to work from the backend by installing the fabric module via npm.
Instead I just added the CDN link in the head and it run in the client.
Related
Just opened my IDE for my project on react and this weird stubborn error popped up on my nodemon server.
node:internal/modules/cjs/loader:998
throw err;
^
Error: Cannot find module 'C:\Users\Hammad\ngo_project\index.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
at Module._load (node:internal/modules/cjs/loader:841:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:23:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.12.1
[nodemon] app crashed - waiting for file changes before starting...
I tried deleting and reinstalling node_modules folder and even package_lock but still the same error is popping.
You will execute the node index.js command
Want to launch a file with the name index.js
You are in the folder of your project, you have this path: C:\Users\Hammad\ngo_project
Your file is not in this folder, maybe you have a folder called "js" or some other name that contains your index.js file.
When you launch the node index.js command.
Node Js is looking for your file in the project C:\Users\Hammad\ngo_project Node Js does not go to other subcathologists, therefore it does not find your index.js file.
You need to move the index.js file to your ngo_project folder.
After that, repeat the launch of the node index.js command.
Also important!
If you have "type": "module" in package.json
You need to use in your index.js connection like this: example import fetch from 'node-fetch';
If "type": "CommonJS" is specified in the package.json file or not specified at all.
You need to use in your index.js connection like this: example const fetch = require('node-fetch');
Good luck!
Try use Yarn, not npm. I use Yarn and it help me.
Delete node_modules and package-lock.json, after that in terminal write yarn install
I created a simple server with express and was using nodemon as a dev dependency. But when I try to exec "npm run dev" getting the following error:
PS D:\R&D\node-backend> npm run dev
> backend#1.0.0 dev
> nodemon ./app.js
'D\node-backend\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
node:internal/modules/cjs/loader:942
throw err;
^
Error: Cannot find module 'D:\nodemon\bin\nodemon.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
at Module._load (node:internal/modules/cjs/loader:780:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.1.0
PS D:\R&D\node-backend>
I tried different solutions from the net and reinstalled nodejs but nothing seems to work. I think there's an issue with where npm is trying to find the package. You can check code here.
I have the same problem in my react project and i found the problem from the folder structure.
I have to change the name of the folder from:
Module 3 practice M1&2 ===> Module 3 practice M1 and 2
for me that "&" is what causing the error
Hope this works
I am receiving the following error after running npm start:
Error: Cannot find module '../build/jvm_dll_path.json'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Module.require (module.js:604:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/opt/stature-gqdss/node_modules/java/lib
[nodemon] app crashed - waiting for file changes before starting...
Can you help me with this issue?
First, you should check if the server is already running and kill the existing server. If no other server is running, try reinstalling your dependencies and try again.
npm install
I have a hack here. You can simply create a file named jvm_dll_path.json inside node_modules\java\build and paste the path of server to this, between quotes like shown below..
";C:\\Program Files\\Java\\jdkX.X.X_XXX\\jre\\bin\\server"
For me running
node postInstall.js
in the node_modules/java folder worked.
Im following a book called "Building Node Applications with Mongo and Backbone". What im creating is a small social network site. Ive followed the steps through but am getting an error with npm config (I think)
when i run the app.js file it comes up with this error
> Error: Cannot find module './config/mail'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
this is the relevant code its referring to.
// Import the data layer
var config = {
mail: require('./config/mail')
};
Any suggestions on how to fix this? Thanks.
Try to install module with npm as admin in console: sudo npm install
I'm trying to deploy a node app onto the Cloudbees ClickStart.
I've create a node js ClickStart (this creates the jenkins job, git repository and application container).
Zipped up my app, then deployed using the Cloudbees SDK.
bees app:deploy -t nodejs -a nodeshort -v nodeshort.zip
When I try to access the URL the application is deployed on I get a 502 Bad Gateway.
Checking the application logs, I see the following printed multiple times:
module.js:340
throw err;
^
Error: Cannot find module '/mnt/e1/genapp-apps/660f9784/main.js'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
What has caused this? More importantly, what can I do to resolve it? I've tried trashing the clickstart and recreating, but I get the same outcome each time.
Thanks
The way in which you zip the file is important.
zip -r ../myapp.zip * => WORKS FINE
zip -r myapp.zip myapp/* => DOES NOT WORK
nodejs stack expect a "main.js" script to be present in application rootdir.
You have this nodejs ClickStart working. Maybe you should compare your code with the ClickStart.