I installed jquery-ui using npm. How can I copy node_modules/jquery-ui/themes/.../images/*.png to public/images directory in Brunch build? I do not want to manually copy files under assets/
after-brunch plug-in does the trick. You can execute arbitrary cmd commands after the build using this plug-in. Many thanks to Creative-Licence-Digital...
Or, you can create a symbolic link from node_modules to app/assets.
Related
I have old project it is using geckofx45 with "xulrunner" folder in project.
I tried to replace it and update with geckofx60 from Nuget package but it doesn't have xulrunner folder after completed but instead it added "Firefox" called folder.
So what should I do? I can't even rebuild project now since I didn't make a copy of old project.
Could you try different initiation path?
Instead of
Xpcom.Initialize();
You could rename your Firefox folder to xulrunner then use
Xpcom.Initialize("xulrunner");
Or you keep the Firefox folder, and use
Xpcom.Initialize("Firefox");
I'm pretty new to grunt & npm etc but I'll explain what my question is as best I can.
I've got a local Wordpress project running with FoundationPress as the theme. I have grunt running etc.
I have just installed Foundation Datepicker via 'bower'. From the terminal it looks like everything went well and the Foundation Datepicker files are in my bower_components/ folder.
However I'm not sure if I should be changing directory to the bower_components/foundation-datepicker/ folder and running 'grunt build' command in that directory to "install" the datepicker? That folder does have a Gruntfile.js in it.
After installing Foundation Datepicker I did run 'grunt build', however that was in the theme folder, so I don't know if that would of picked up the newly downloaded Foundation Datepicker and installed/built that too.
It does say on the GitHub page towards the bottom that I should do a 'grunt build'. Please see here again: https://github.com/najlepsiwebdesigner/foundation-datepicker
Thanks guys.
Daniel.
I can't see .bowerrc file in the project
In the .bowerrc file, you should have the path like bower_components/folder as you want or bower_components/foundation-datepicker/folder
Probable solution -
Make a file named .bowerrc at the root level and put the path there as
{
"directory" : "js" //according to your present "foundation-datepicker.js" file location
}
I have realised that in my lack of experience in installing bower components to FoundationPress, that I was supposed to reference the files in the DOM myself once they had been downloaded using the 'bower install foundation-datepicker' command.
I have copied the files over to the suggested folders as in he README.md file and referenced the files in the DOM. The datepicker feature is now working.
So in conclusion I did run 'grunt build' in my theme directory after the 'bower install foundation-datepicker' command, and I believe this was required based on the README.md.
Finally yes you do need to run 'grunt build' but only in your theme directory. But you need to refence the fils yourself in order to use them in your project.
I have a project setup that is as follows:
workspace
└cache
└node_modules
└gulp (and gulp-plugins, express etc.)
└nodejs
└node.exe
└project1
└gulpfile.js
└project2
└gulpfile.js
Now I want to execute the gulpfile in the project directories:
set NODE_PATH='C:\workspace\cache\node_modules\'
cd C:\workspace\project1\
C:\workspace\nodejs\node.exe C:\workspace\cache\node_modules\gulp\bin\gulp.js watch
and I get the following output:
[12:06:04] Local gulp not found in C:\workspace\project1
[12:06:04] Try running: npm install gulp
In both project folders the gulpfile is similar and uses a similar set of plugins. I'd really like to have the dependencies only once (because potentially I have up to 25 projects sharing the same node_modules).
Is this setup possible, or does the seperate project directories need to have their own node_modules folders?
Gulp requires you to have both a global installation as well as a local one. So you need to have your Gulp relatively to your Gulpfile. If your package.json would be located in workspace and your node_modules would be in workspace/node_modules everything would work fine because of Node's search tree, but if you can't move them, the only way to make it work is to "fake" the node_modules folder.
You can do this by creating a symbolic link.
Here's on Unix/Linux/Mac:
ln -s ../cache/node_modules node_modules
Here's on Windows
mklink /D node_modules ../cache/node_modules
(the latter one might work different, I'm not on a Win machine)
You could also try pkglink
From description:
Space saving Node.js package hard linker. pkglink locates common JavaScript/Node.js packages from your node_modules directories and hard links the package files so they share disk space.
Edit: ddprt
On Windows
mklink /D node_modules "C:/fullPATH/cache/node_modules"
you could always use the '-g' parameter with npm install 'package-name', so as to make the module available globally to access across different projects.
See the following links
what does the "-g" flag do in the command "npm install -g <something>"?
How do I install a module globally using npm?
https://docs.npmjs.com/files/folders
Packages are dropped into the node_modules folder under the prefix. When installing locally, this means that you can require("packagename") to load its main module, or require("packagename/lib/path/to/sub/module") to load other modules.
Global installs on Unix systems go to {prefix}/lib/node_modules.
Global installs on Windows go to {prefix}/node_modules (that is, no
lib folder.)
Scoped packages are installed the same way, except they are grouped
together in a sub-folder of the relevant node_modules folder with the
name of that scope prefix by the # symbol, e.g. npm install
#myorg/package would place the package in
{prefix}/node_modules/#myorg/package.
Does anyone know how to get a hogan.js 3.0.0 dist file?
The files at https://github.com/twitter/hogan.js are source files that should be compiled with Node.js in order to create the distributable. My question is how to build the source files with Node on Windows, or a link to a pre-built distributable file.
The dist file is mentioned here: https://github.com/twitter/hogan.js/blob/master/lib/hogan.js#L16
Hogan uses a Makefile to create dist builds and do testing. This can be envoked by running make dist from a NIX terminal. https://github.com/twitter/hogan.js/issues/156
If you want to avoid using the Makefile, because you are running node.js from a Windows command prompt or for whatever reason, you need to create a ./dist directory in Hogan's root directory where the package.json is, then run node tools\release.js.
Make sure you've installed the dev-dependencies with npm install in the same directory as the package.json first.
When I try to upload my Node.js project on Elastic Beanstalk I obtain the following error:
Failed to find package.json. Node.js may have issues starting. Verify package.json is valid or place code in a file named server.js or app.js.
However, I have the package.json in the main directory.
A couple of people were zipping the parent folder incorrectly. You need to select all the contents of the folder and zip those.
https://forums.aws.amazon.com/message.jspa?messageID=477087
https://forums.aws.amazon.com/thread.jspa?threadID=130140&tstart=0
While uploading the .zip file (Nodejs application) we need to select all the files in the folder, then zip it as shown in below screenshot.
Then upload the Nodejs(zip file) project in AWS Elastic Beanstalck.
I had the same issue running a zip of node js boilerplate. It worked when I removed .git and .idea directories and n.gitignore file from the zip.
You need to zip the build directory, to do so inside that directory you can zip -r upload.zip . (do not forget the dot at the end for current directory).
So in that directory you need to have your index.js or server.js as EB looks for how to run the app in the directory only and will not look into folders src, dist etc.
This can be the packaging issue. You will need to go inside the project and compress altogether as provided in the screenshot:
If you use eb cli, make sure you have git committed all the changes.
If you do zip and upload, make sure you don't zip the parent folder but selecting all files and zip.
In my case i have found a wrong copy of the folder .elasticbeanstalk with inside another config.yml
example
root_project_folder
.elasticbeanstalk/
config.yml
public/
.elasticbeanstalk/
config.yml
and when I started the "eb deploy" command it failed because use the wrong public/ folder as a ROOT
removing the public/.elasticbeanstalk/ have resolved my issue
Ciao