npm start ReferenceError: window is not defined
npm start ReferenceError: window is not defined
When i run "npm start" on my app after adding datatables, i get this basic error. I am new to datatables. Could you please let me know what i am doing wrong?
Steps taken:
1. Followed the instructions for a basic setup:
npm install datatables.net # Core library
npm install datatables.net-dt # Styling
Tried adding the recommended lines in app.js and in the user.js:
var $ = require( 'jquery' );
var dt = require( 'datatables.net' )();Initilized the datatables:
$(document).ready( function () {
$('#table_id').DataTable();
} );
Got the following error. I believe i am not integrating my datatables code with the existing code but if anyone could suggest a solution, that would e greatly appreciated!
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@6.9.0
3 info using node@v12.4.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle fa-express@0.0.0~prestart: fa-express@0.0.0
6 info lifecycle fa-express@0.0.0~start: fa-express@0.0.0
7 verbose lifecycle fa-express@0.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle fa-express@0.0.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/rpaauto/RPA/fa-express/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle fa-express@0.0.0~start: CWD: /home/rpaauto/RPA/fa-express
10 silly lifecycle fa-express@0.0.0~start: Args: [ '-c', 'node ./bin/www' ]
11 silly lifecycle fa-express@0.0.0~start: Returned: code: 1 signal: null
12 info lifecycle fa-express@0.0.0~start: Failed to exec start script
13 verbose stack Error: fa-express@0.0.0 start: node ./bin/www
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:200:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:200:13)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid fa-express@0.0.0
15 verbose cwd /home/rpaauto/RPA/fa-express
16 verbose Linux 4.18.0-20-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v12.4.0
19 verbose npm v6.9.0
20 error code ELIFECYCLE
21 error errno 1
22 error fa-express@0.0.0 start: node ./bin/www
22 error Exit status 1
23 error Failed at the fa-express@0.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
Answers
Hi @GBC ,
Would you be able to package up your project so we could try it here?
Cheers,
Colin