docs(aio) - yarn post-install failure due to --source-map not being provided in package.json
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
When performing ‘yarn’ as instructed in AIO master documentation, failure occurs with error in fs module (fs.js:641) on binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);. Bubbled up error is “TypeError: path must be a string or Buffer”.
Expected behavior
‘yarn’ installs dependencies without error, including the execution of ‘postinstall’.
Minimal reproduction of the problem with instructions
Pull latest angular repo on Windows 7 machine and attempt to follow the instructions contained within aio\readme.md - beginning with simply running ‘yarn’.
What is the motivation / use case for changing the behavior?
Documentation should build using the documented build process.
Environment
Angular version: 4.3.1
For Tooling issues:
- Node version: 6.11.2
- Platform: Windows 7 x64
Others:
If you look at the package.json in angular/aio/ you will note that the 'postinstall' has a trailing --source-map, but that there is no output file specified for the --source-map flag for uglifyjs. Removing the trailing --source-map allows for yarn install without error. Providing a valid value for --source-map also results in a yarn install without error.
If you debug uglifyjs, --source-map without valid path ARGS.source_map comes through as truthy and so "if(SOURCE_MAP)" is active, though ARGS.source_map does not contain a valid path - hence the error.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Error Codes | Yarn - Package Manager
This error means that this process failed and Yarn cannot successfully figure out which version of the package should be added to your...
Read more >Source map errors — Firefox Source Docs documentation
The error tells us that the source map is not JSON data — so we're serving the wrong file. There are a few...
Read more >A guide through The Wild Wild West of setting up a mono repo ...
This is were the fun starts! Setting up a mono repo from scratch. We will be using TypeScript, Yarn workspaces, Lerna, and Jest....
Read more >source-map - npm
Start using source-map in your project by running `npm i source-map`. ... TypeScript icon, indicating that this package has built-in type ...
Read more >Why npm Scripts? - CSS-Tricks
There has been a growing sentiment (for instance) that using node packages directly, with the command line interfaces they provide, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You da man! Thanks for the education, @gkalpak .
I’ve blown away my node_modules and everything is exactly as you described now that I’ve reran yarn 0.24.6…
Bare minimum, I am hoping that others banging their head in frustration over this error stumble here to get a quick answer (as I couldn’t find anything on this specifically last night or this morning) 😃
Thanks again for your assistance!
If you remove
node_modules/
and install again using yarn 0.24.6 everything should work as expected. The issue happens because yarn 0.27.5 has installed an older version of uglifyjs in thenode_modules/.bin/
directory. That old, incorrect version of uglifyjs has a different API (i.e. expects different command-line arguments) and thus breaks.