Skip to main content

Bug Tracker

Side navigation

#14548 closed bug (fixed)

Opened November 15, 2013 04:50PM UTC

Closed November 15, 2013 10:07PM UTC

npm jQuery does not have a main module

Reported by: domenic@domenicdenicola.com Owned by: timmywil
Priority: blocker Milestone: 1.11/2.1
Component: core Version: 2.1.0-beta1
Keywords: Cc:
Blocked by: Blocking:
Description

Because jquery's package.json does not have a "main" field, it's not possible to require jQuery.

Steps to reproduce:

npm install jquery@2.1.0-beta2

echo "var $ = require('jquery');" > test.js

node test.js

Throws error: cannot find module 'jquery'.

I'd suggest exposing dist/jquery.js as the main module.

Attachments (0)
Change History (3)

Changed November 15, 2013 05:41PM UTC by timmywil comment:1

component: unfiledcore
milestone: None1.11/2.1
owner: → timmywil
priority: undecidedblocker
status: newassigned

I absolutely agree we need a main property. I seem to recall that we had this property at one point and it was removed, but that could be totally wrong.

Changed November 15, 2013 05:42PM UTC by timmywil comment:2

For now, require('jquery/dist/jquery') or require('jquery/src/someModule') is a workaround.

Changed November 15, 2013 10:07PM UTC by Timmy Willison comment:3

resolution: → fixed
status: assignedclosed

Fixes #14548. Add main property to package.json

Changeset: 6fde9752599f035da5e328b54a1e23e075e4ad45