charlottegore / cassette-express Goto Github PK
View Code? Open in Web Editor NEWAn asset manager for your client side javascript files, for use in Express.JS
License: MIT License
An asset manager for your client side javascript files, for use in Express.JS
License: MIT License
Thanks for creating this package! I'm hoping to use it on a production site sometime soon. However, there's a blocking issue for us which is that it doesn't work when using node on Windows, and it looks like the problems are related to file paths. Starting with just a clone of the repo and changing to the Example directory, I ran npm install and then node app.js. This immediately throws the following error:
fs.js:400
return binding.readdir(pathModule._makeLong(path));
Error: ENOENT, no such file or directory 'D:\node_modules'
at Object.readdirSync (fs.js:400:18)
at base.scanDirectory (D:\Dev\Cassette-Express\EXAMPLE\node_modules\cassette-express\lib\manifest.js:32:18)
at base.reset (D:\Dev\Cassette-Express\EXAMPLE\node_modules\cassette-express\lib\manifest.js:122:8)
at base.init (D:\Dev\Cassette-Express\EXAMPLE\node_modules\cassette-express\lib\manifest.js:24:8)
The problem stems from the call this.scanDirectory( node );
on line 119 of manifest.js. The call to path.relative on the preceding line results in a path like ..\..\..\..\..\node_modules
in my case (I have the repo located at D:\dev\cassette-express on my system). So that resolves to D:\node_modules which doesn't exist.
I'm not sure exactly why it's trying to scan the node_modules folder, but if I take that line out the app will run. But then another path problem becomes apparent. If I browse to localhost:3000 the page loads but none of the scripts get loaded. And that's because if you look at the source, it's rendering script tags with a src attribute like this:
src="\javascripts\lib\underscore.js"
Notice that the src is using \
instead of /
which is preventing the browser from loading them.
If I can figure out what exactly needs changed in the source to fix these issues, I'll be happy to issue a pull request. Not sure how long it will take me to figure out what's going on though. :-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.