ng-packagr: [BUG] No such file or directory, open 'node_modules\src\util\root.ts'
Type of Issue
[x ] Bug Report
[ ] Feature Request
Description
> ng-packagr -p package.json
Building Angular library
Generating bundle for project
Cleaning bundle build directory
Processing assets
Running ngc
Compiling to FESM15
'default' is not exported by 'node_modules\rxjs\add\operator\toPromise.js'
Compiling to FESM5
Compiling to UMD
Minifying UMD bundle
Side effects in initialization of unused variable ez [0:80,12]
Dropping side-effect-free statement [0:2738,17]
Dropping side-effect-free statement [0:3243,21]
Dropping side-effect-free statement [0:4926,17]
Dropping side-effect-free statement [0:6090,21]
Dropping duplicated definition of variable gV [0:6518,16]
Dropping duplicated definition of variable fV [0:6525,17]
Dropping unreachable code [0:15959,0]
Declarations in unreachable code! [0:15959,0]
Dropping unreachable code [0:17346,0]
Declarations in unreachable code! [0:17346,0]
Side effects in initialization of unused variable sya [0:19408,53]
Side effects in initialization of unused variable tya [0:19408,89]
Side effects in initialization of unused variable uya [0:19408,131]
Dropping duplicated definition of variable nFa [0:21288,17]
Side effects in initialization of unused variable V [0:813,4]
Side effects in initialization of unused variable W [0:814,4]
Side effects in initialization of unused variable fa [0:1128,4]
Side effects in initialization of unused variable ga [0:1129,4]
Side effects in initialization of unused variable ha [0:1130,4]
Dropping duplicated definition of variable f [0:1537,4]
Side effects in initialization of unused variable Ab [0:2648,4]
Side effects in initialization of unused variable Bb [0:2649,4]
Side effects in initialization of unused variable Cb [0:2650,4]
Side effects in initialization of unused variable Ip [0:15332,4]
Side effects in initialization of unused variable ev [0:19436,4]
Side effects in initialization of unused variable fv [0:19437,4]
Side effects in initialization of unused variable $x [0:21698,4]
Side effects in initialization of unused variable ly [0:22074,4]
Side effects in initialization of unused variable my [0:22075,4]
BUILD ERROR
ENOENT: no such file or directory, open 'C:\Users\xxxxxx\node_modules\src\util\root.ts'
Error: ENOENT: no such file or directory, open 'C:\Users\xxxxxx\node_modules\src\util\root.ts'
npm ERR! code ELIFECYCLE
npm ERR! errno 111
npm ERR! xxx@1.0.0 packagr: `ng-packagr -p package.json`
npm ERR! Exit status 111
npm ERR!
npm ERR! Failed at the xxx@1.0.0 packagr script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xx\AppData\Roaming\npm-cache\_logs\2018-04-09T11_24_23_994Z-debug.log
Version Information
npm : 5.6.0 node: 8.9.4
+-- @angular/cli@1.4.10
+-- @angular/common@4.4.6
+-- @angular/compiler@4.4.6
+-- @angular/compiler-cli@4.4.6
+-- @angular/core@4.4.6
+-- @angular/forms@4.4.6
+-- @angular/http@4.4.6
+-- @angular/language-service@4.4.6
+-- @angular/platform-browser@4.4.6
+-- @angular/platform-browser-dynamic@4.4.6
+-- @angular/router@4.4.6
+-- @compodoc/compodoc@1.0.6
+-- @types/jasmine@2.5.54
+-- @types/jasminewd2@2.0.3
+-- @types/node@6.0.104
+-- codelyzer@3.1.2
+-- core-js@2.5.5
+-- jasmine-core@2.6.4
+-- jasmine-spec-reporter@4.1.1
+-- karma@1.7.1
+-- karma-chrome-launcher@2.1.1
+-- karma-cli@1.0.1
+-- karma-coverage-istanbul-reporter@1.2.1
+-- karma-jasmine@1.1.1
+-- karma-jasmine-html-reporter@0.2.2
+-- ng-packagr@1.7.0
+-- protractor@5.3.0
+-- rollup-plugin-commonjs@8.3.0
+-- rxjs@5.5.8
+-- ts-node@3.2.2
+-- tslint@5.3.2
+-- typescript@2.3.4
`-- zone.js@0.8.26
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 9
- Comments: 18 (1 by maintainers)
Commits related to this issue
- Fix for BUG #758 — committed to EQUILIBRIO/ng-packagr by alexisrodriguezead 4 years ago
I tried
npm install uglify-js@3.3.18, but the problem seems still exists.Seems that the culprit is: uglify-js. I run:
npm install uglify-js@3.3.18to downgrade uglify-js and try to build again and worked.
my current version is 1.6.x, when I upgrade to 1.7.x and degrade the uglify-js, it works, thank you @dmeneses
@ghiscoding, would have spend days in this issue, if i haven’t found your reply. Thank you.
Hey guys, I also encountered this problem while running an
npm installon my lib project. This was fixed in latest2.xversion but if you are running1.x, then you could edit a file under thenode_modules/ng-packagr/src/lib/flatten/uglify.jsand do this changeas can be seen in the
2.x versioncommit fix that was merged and released under2.4.2I think this will work with any version of
uglify-jsthat is>=3.x