Skip to content

ng build library throw error "BUILD ERROR returned value of file must be a string" #11185

@SvenBudak

Description

@SvenBudak
- [x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [x] devkit
- [ ] schematics

Versions

Node: v8.9.4
NPM: 6.0.1
Windows 10

Repro steps

Step 1
ng new ngx-mark6 --style=scss --routing --skip-install

Step 2
ng generate library mark6-lib --prefix mark6

Step 3
ng build mark6-lib

The log given by the failure

C:\Users\sven\PhpstormProjects\ngx-mark6>ng build mark6-lib
Building Angular Package
Building entry point 'mark6-lib'
Rendering Stylesheets

BUILD ERROR
returned value of `file` must be a string
Error: returned value of `file` must be a string
    at options.error (C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\node-sass\lib\index.js:291:26)

returned value of `file` must be a string
Error: returned value of `file` must be a string
    at options.error (C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\node-sass\lib\index.js:291:26)

Desired functionality

Want to build a external library

Mention any other details that might be useful

The Repo to check relevant things i maybe forgot: https://github.com/DevMonkeysDE/ngx-mark6

And by the way: Sometimes npm install work and sometimes not. Remember this is a totaly clean CLI generated Project... Error Message:

C:\Users\sven\PhpstormProjects\ngx-mark6>npm install
npm WARN ngx-mark6@0.0.0 No repository field.
npm WARN ngx-mark6@0.0.0 No license field.

npm ERR! path C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\@types\jasminewd2\package.json.3702476408
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\@types\ja
sminewd2\package.json.3702476408' -> 'C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\@types\jasminewd2\package.j
son'
npm ERR!  { Error: EPERM: operation not permitted, rename 'C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\@types
\jasminewd2\package.json.3702476408' -> 'C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\@types\jasminewd2\packag
e.json'
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, rename 'C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\@typ
es\jasminewd2\package.json.3702476408' -> 'C:\Users\sven\PhpstormProjects\ngx-mark6\node_modules\@types\jasminewd2\pack
age.json'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'rename',
npm ERR!      path: 'C:\\Users\\sven\\PhpstormProjects\\ngx-mark6\\node_modules\\@types\\jasminewd2\\package.json.37024
76408',
npm ERR!      dest: 'C:\\Users\\sven\\PhpstormProjects\\ngx-mark6\\node_modules\\@types\\jasminewd2\\package.json' },
npm ERR!   stack: 'Error: EPERM: operation not permitted, rename \'C:\\Users\\sven\\PhpstormProjects\\ngx-mark6\\node_m
odules\\@types\\jasminewd2\\package.json.3702476408\' -> \'C:\\Users\\sven\\PhpstormProjects\\ngx-mark6\\node_modules\\@types\\jasminewd2\\package.json\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'C:\\Users\\sven\\PhpstormProjects\\ngx-mark6\\node_modules\\@types\\jasminewd2\\package.json.3702476408',
npm ERR!   dest: 'C:\\Users\\sven\\PhpstormProjects\\ngx-mark6\\node_modules\\@types\\jasminewd2\\package.json',
npm ERR!   parent: 'ngx-mark6' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\sven\AppData\Roaming\npm-cache\_logs\2018-06-09T22_53_39_829Z-debug.log

If i retry it, it after 1 or 2 more trys works. I just post this error log in case this have anything to do with my problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions