Comments (4)
@codyhatch Looking at 75265ac, that fix only addresses removal of optionalDependencies
that are specified in the top-level package.json
for your project - it does not look to handle the optionalDependencies
specified by your transitive deps.
As a work-around for the time being, you can add fsevents
to the optionalDependencies
in the package.json
for your application.
I think the correct fix here would be to prune optional dependencies that exist anywhere in the tree, as @palmerj3 pointed out in #74.
@JamieMason thoughts?
from shrinkpack.
Agree @DrewML that you'd have to pluck optionalDependencies
from every package.json
in the dependency graph to then prune it from the shrinkwrap.
I'll think about this some more, but I'm initially hesitant because I'm already not content with how much shrinkpack
has needed to be a bag of patches for upsteam npm shrinkwrap
issues. That said, npm shrinkwrap
is shrinkpack
's source of data, so it's pretty difficult to avoid.
from shrinkpack.
I'll close #74 as a duplicate as there is more discussion in this thread.
According to NPM if you remove optionalDependencies in npm-shrinkwrap.json but they still exist in package.json NPM will install them anyways. I totally disagree with this behavior and will be working on a NPM PR to remove this behavior entirely. But I think you could handle this in shrinkpack.
Certainly removing optionalDeps from top level package.json would be doable but it's not clear to me right now if you will also need to handle this for lower level packages.
– @palmerj3
from shrinkpack.
I've pushed a change to feat/75-nested-optional-deps which seems to work well, using the "optional": true
properties found in shrinkwraps generated by newer versions of npm.
The test suite will need updating before it can be released though, as the pruning of optional dependencies results in different files in node_modules (the default behaviour when doing an npm install normally is to include optional dependencies).
from shrinkpack.
Related Issues (20)
- npm install fails after clone with some dependencies HOT 4
- shrinkpack 'is not recognized....' on Windows 10 HOT 3
- --compress flag issues on Windows HOT 6
- Update node & npm versions used in CI HOT 1
- Add support for npm5 HOT 86
- Handle local (file:) dependencies HOT 3
- after upgrate to ionic 3.. npm install failed, I cant create new app HOT 5
- Can't run shrinkpack after upgrading from npm v4.6.1 to v5.0.3 HOT 2
- NPM5 – npm ERR! aggregate error HOT 6
- UnhandledPromiseRejectionWarning: Unhandled promise rejection HOT 7
- Add Monorepo support
- Reference useful npm documentation in readme
- Add guides/recipes HOT 7
- Task: Ensure paths are always / in package lock
- npm 6 support (removed the `npm cache ls`) HOT 1
- Error: ! failed to read contents of npm cache HOT 1
- Integrities are concatenated HOT 5
- failed to read contents of npm cache
- A package+version tarball can be insufficient if platform libraries are needed HOT 2
- { "scripts": { "precompress": "{{ executes BEFORE the `compress` script }}", "compress": "{{ run command to compress files }}", "postcompress": "{{ executes AFTER `compress` script }}" } }
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shrinkpack.