question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

docs(aio) - yarn post-install failure due to --source-map not being provided in package.json

See original GitHub issue

I’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:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mattezellcommented, Aug 2, 2017

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!

1reaction
gkalpakcommented, Aug 2, 2017

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 the node_modules/.bin/ directory. That old, incorrect version of uglifyjs has a different API (i.e. expects different command-line arguments) and thus breaks.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found