Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#25803 closed Uncategorized (worksforme)

npm test failure

Reported by: Nikolas N Owned by: nobody
Component: Uncategorized Version: dev
Severity: Normal Keywords: javascript
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Nikolas N)

Following the instructions to run the JavaScript tests here: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/javascript/#running-tests

I run npm install, then npm test. I'm using node.js v4.2.1, npm v3.4.1.

The command fails, and here's the output:

$ npm test

> Django@ pretest /home/nnyby/src/django
> eslint django/ js_tests/admin/ js_tests/gis/


django/contrib/admin/static/admin/js/SelectFilter2.js
   78:178  warning  Script URL is a form of eval  no-script-url
   84:138  warning  Script URL is a form of eval  no-script-url
   86:141  warning  Script URL is a form of eval  no-script-url
  108:181  warning  Script URL is a form of eval  no-script-url

django/contrib/admin/static/admin/js/admin/DateTimeShortcuts.js
  108:42  warning  Script URL is a form of eval  no-script-url
  111:44  warning  Script URL is a form of eval  no-script-url
  149:85  warning  Script URL is a form of eval  no-script-url
  150:90  warning  Script URL is a form of eval  no-script-url
  151:88  warning  Script URL is a form of eval  no-script-url
  152:86  warning  Script URL is a form of eval  no-script-url
  153:88  warning  Script URL is a form of eval  no-script-url
  157:67  warning  Script URL is a form of eval  no-script-url
  216:44  warning  Script URL is a form of eval  no-script-url
  219:42  warning  Script URL is a form of eval  no-script-url
  258:71  warning  Script URL is a form of eval  no-script-url
  260:71  warning  Script URL is a form of eval  no-script-url
  272:71  warning  Script URL is a form of eval  no-script-url
  274:67  warning  Script URL is a form of eval  no-script-url
  276:70  warning  Script URL is a form of eval  no-script-url
  281:67  warning  Script URL is a form of eval  no-script-url

django/contrib/admin/static/admin/js/calendar.js
  104:60  warning  Script URL is a form of eval  no-script-url

✖ 21 problems (0 errors, 21 warnings)


> Django@ test /home/nnyby/src/django
> grunt test --verbose

Initializing
Command-line options: --verbose

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Initializing config...OK

Registering "grunt-blanket-qunit" local Npm module tasks.
Reading /home/nnyby/src/django/node_modules/grunt-blanket-qunit/package.json...OK
Parsing /home/nnyby/src/django/node_modules/grunt-blanket-qunit/package.json...OK
Loading "blanket_qunit.js" tasks...ERROR
>> Error: Cannot find module 'grunt-contrib-qunit/node_modules/grunt-lib-phantomjs'
>>     at Function.Module._resolveFilename (module.js:337:15)
>>     at Function.Module._load (module.js:287:25)
>>     at Module.require (module.js:366:17)
>>     at require (module.js:385:17)
>>     at Object.module.exports (/home/nnyby/src/django/node_modules/grunt-blanket-qunit/tasks/blanket_qunit.js:23:21)
>>     at loadTask (/home/nnyby/src/django/node_modules/grunt/lib/grunt/task.js:325:10)
>>     at /home/nnyby/src/django/node_modules/grunt/lib/grunt/task.js:361:7
>>     at Array.forEach (native)
>>     at loadTasks (/home/nnyby/src/django/node_modules/grunt/lib/grunt/task.js:360:11)
>>     at Task.task.loadNpmTasks (/home/nnyby/src/django/node_modules/grunt/lib/grunt/task.js:408:5)
Loading "Gruntfile.js" tasks...OK
+ default, test

Running tasks: test

Running "test" task
Warning: Task "blanket_qunit" not found. Use --force to continue.

Aborted due to warnings.
npm ERR! Test failed.  See above for more details

Change History (9)

comment:1 by Tim Graham, 8 years ago

I guess it might be related to the node version -- we are using the version packaged for Ubuntu 14.04 -- 0.10.25. Could you investigate?

comment:2 by Nikolas N, 8 years ago

I got the same errors using Node 0.10.25 on Ubuntu 14.04:

http://dpaste.com/22738JV

comment:3 by Tim Graham, 8 years ago

Can you try googling the error in your log ouput, "Error: Cannot find module 'grunt-contrib-qunit/node_modules/grunt-lib-phantomjs". e.g. https://github.com/gruntjs/grunt-contrib-qunit/issues/26#issuecomment-22134722 might help.

comment:4 by Nikolas N, 8 years ago

I'm able to execute phantomjs, so that's not the issue. I looked around but none of the proposed solutions I've found have worked for me so far. I will try to figure this out, but the error seems reproducible so I thought this was an issue with Django's grunt setup.

comment:5 by Tim Graham, 8 years ago

Resolution: worksforme
Status: newclosed

Okay, please reopen if the problem turns out to be Django's fault. Thanks!

comment:6 by Nikolas N, 8 years ago

Description: modified (diff)

comment:7 by Nikolas N, 8 years ago

I've solved the problem: using an older version of npm, the tests work for me. npm 2.x works, but npm 3.x doesn't.

comment:8 by Tim Graham <timograham@…>, 8 years ago

In d7a58f2:

Refs #25803 -- Documented npm compatibility in package.json

comment:9 by Tim Graham <timograham@…>, 8 years ago

In abd8706:

[1.9.x] Refs #25803 -- Documented npm compatibility in package.json

Backport of d7a58f285b4c0c1b4ec032f9a7bf8f31913d0f5f from master

Note: See TracTickets for help on using tickets.
Back to Top