ZURB Foundation npm build not creating `dist` directory - zurb-foundation-6

I've followed the directions at http://foundation.zurb.com/sites/docs/installation.html#command-line-tool.html and there is no dist directory created. There are several dist directories scattered throughout the sub-folders, but not one unified directory with all the files in it.
I've tried both npm start and npm run build.
How do I get the dist directory created?

Related

npm link only dist folder

Is there a way to restrict npm link to create the symlink only to point at ./dist?
I am struggling so far as I want to test my library (react component) locally before publishing.
In my package.json I have included the main (entry point):
"main": "./dist/index.js"
But still when I run npm link it links to the parent folder which has node_modules and so on.
This is causing problems cause now I have 2 react apps installed.
I thought of a way to exclude node_modules but I couldn't even find a way to do that.
This is actually simpler than expected. First run ng build to build your library project, then go under the dist folder and run npm link from there instead of the library root project. The symlink will be created pointing to the dist folder instead.
Using "main" parameter doesn't make sense because npm link use 'npm prefix' for create symlink
see here
You can use next hack:
Cd to project directory
Copy package.json from package to ./dist/package.json directory
Cd to dist directory
Run 'npm link'
It looks dirty but seem to only way to do it with npm link

npm prepare script not building folder in node modules

I am trying to use npm's prepare script to run a build step when npm installing from a different project.
The script does run during the npm install however, it doesn't build out the dist folder inside node modules.
Refer to this article for more details http://jim-nielsen.com/blog/2018/installing-and-building-an-npm-package-from-github/
I also had the same problem. My prepare script wasn't creating the build directory in the node_modules folder when installing as dependency.
Finally I found out that my .gitignore was the problem, which was setup to ignore the build directory for version control. NPM is inheriting the .gitignore file when no .npmignore can be found, which was the case here.
As stated on https://docs.npmjs.com/misc/developers:
If there’s no .npmignore file, but there is a .gitignore file, then npm will ignore the stuff matched by the .gitignore file
So I solved the problem by simply adding an empty .npmignore in the root.
I hate to provide such a simple answer, but my solution was to use npm install rather than yarn, which apparently doesn't run the prepare script properly.

How to configure node_modules folder location in npm project?

I have a node application in which I am using package.json file which on npm install make a node_modules folder inside the application folder which have all dependencies in it. I want to move node_modules folder out from application folder without causing the code break. Basically I want to manually configure the location of local node modules. How can I do that?

npm install local folder only installs node_modules

I want to install a local project by using "file:../project-name" in the package.json. However, when I run this command it only installs the dependencies of the local project (node_modules) and not the source files itself.
I have project-name/src for example and I expect it to appear in node_modules/project-name/src, but it doesn't.
I checked the .gitignore (I don't have a .npmignore file) and src as a folder is not excluded.
What am I not seeing here?
If you refer to the files property, this does not indicate files to copy to the node_modules on npm install, but it indicates the files to publish on npm publish.
Edit
When including a dependency with file:... in a project, the directory has to:
have a package.json
Declare exported files in the "files" property.

npm not creating node_modules folder in project directory

I am doing a small Sinatra project and I want to use Gulp.
I have node(v0.12.0), npm(2.13.1), gulp(3.9.0) installed. I am in my project directory but when I try install a package like "npm install gulp-sass --save-dev", it doesn't create any "node_modules" folder in my project directory. It seems to be installing the package in my user home directory. Anything I am doing wrong?
From the npm documentation:
Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a package.json file, or a node_modules folder. If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands. (This behavior is inspired by and similar to git's .git-folder seeking logic when running git commands in a working dir.)
If no package root is found, then the current folder is used.

Resources