Unprepared jqueryify module not found

My situation

I am checking spine.js for the web application that I am thinking of writing about. I read all the documentation and looked through all the examples. Now I am trying to run the spine.contacts project on my own windows 7 laptop.

I am running node v0.6.6 for windows

What I've done

  • Installed node
  • Installed spine, spine and margin through npm
  • Extracted spine.contacts in a folder
  • Run npm install . inside the folder that created the node_modules folder with a bunch of directories inside, including jqueryify
  • Run hem server to start the test server
  • Basically all the instructions for the letter are followed

Problem

Running the application in Chrome (http: // localhost: 9294), JavaScript throws an exception on line 9 in index.html (I included index.html below). He reads "The unprepared jqueryify not found module." I know that the jqueryify dependency was installed on npm before, but I still tried to remove this line and manually bind in jQuery. Now I got the error "Uncaught module index not found" in application.js. This, of course, is not a dependency error, since the index.js file is local and is the main script file in the project.

So there is a problem with the require function. I searched a lot and found nothing, pointed out that spine.js should not work on Windows.

Any ideas?


Some links


index.html

 <!DOCTYPE html> <html> <head> <meta charset=utf-8> <title>App</title> <link rel="stylesheet" href="/application.css" type="text/css" charset="utf-8"> <script src="/application.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" charset="utf-8"> var jQuery = require("jqueryify"); // I'm line 9!! var exports = this; jQuery(function(){ var App = require("index"); exports.app = new App({el: $("#article")}); }); </script> </head> <body> <header id="header"><h1>Spine Contacts</h1></header> <article id="article"></article> </body> </html> 
+4
source share
2 answers

Hem is not supported on Windows. I found myself in the same situation and tried the same approaches.

More info here: https://github.com/maccman/hem/issues/23

+2
source

Try pasting this before line 9:

 for(var winPath in require.modules) { path = winPath.replace(/\\/g, '/'); path = path.match('/node_modules/') ? path.split('/node_modules/')[1] : path; path = path.match('/app/') ? path.split('/app/')[1] : path; require.modules[path] = require.modules[winPath]; } 

I think the fix will be soon.

+1
source

Source: https://habr.com/ru/post/1388983/


All Articles