Fix cache/path issue with npm 7 #7
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tested on Windows 10 (MSYS2), Ubuntu 18.04 amd64 (VMware Fusion), Fedora 33, Manjaro 18.1, with both npm 6 and npm 7.
The only awkward result was on the Ubuntu VM, where installing Fomantic is blazing fast with npm 6 but takes quite some time (more than 40 seconds) to complete with npm 7, probably due to VM-specific performance issue with filesystem. Webpack doesn't suffer from this (10 seconds). Symlinking and even moving
.npm-cache
didn't help. More testing is welcome.Note that npm 7 really requires both
package.json
andpackage-lock.json
for cache to work at all. This wasn't the case for npm 6. For this reason, the--no-package-lock
switch is dropped for Fomantic.package-lock.json
will be deleted and regenerated each timemake npm-cache
runs while being ignored by Git at all time.Other fixes involve working with the npm 7 path issue (using
echo
for.npmrc
manipulation asnpm config
resolves relative paths to absolute paths, making the tarball not portable), as well as miscellaneous fixes (using$OLDPWD
instead of../../
as latter is not portable if$(FOMANTIC_PATH)
is moved; removing the leading/
from.npm-cache
andnode_modules
in.gitignore
as they should be ignored at any directory level)