Package Creation Errors

Hi! iwas trying to create kibana rpm package "npm run build -- --rpm", and went ran into this issue.

Fatal error: Path must be a string. Received true
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kibana@6.0.0-alpha2 build: grunt build "--rpm"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kibana@6.0.0-alpha2 build 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! /home/farya/.npm/_logs/2017-05-31T10_36_12_445Z-debug.log

i did try upgarding my babel-core@6.10.4 but that agin didnt help me out.

2 Likes

hi, i too face the same problem can anyone help us?

1 Like

Could you share the contents of /home/farya/.npm/_logs/2017-05-31T10_36_12_445Z-debug.log here? There might be some further clues in there.

Also, could you share the complete output of npm run build -- --rpm as well? That will give me a better idea of where the build process failed.

Thanks,

Shaunak

[farya@kibanasgpl kibana]$ npm run build -- --rpm

kibana@6.0.0-alpha2 build /home/farya/kibana
grunt build "--rpm"

Running "build" task

Running "clean:build" (clean) task

1 path cleaned.

Running "clean:target" (clean) task

0 paths cleaned.

Running "_build:downloadNodeBuilds" task

Downloading darwin-x86_64 and corresponding sha
Downloading linux-x86_64 and corresponding sha
Downloading windows-x86_64 and corresponding sha
darwin-x86_64 downloaded and verified
linux-x86_64 downloaded and verified
windows-x86_64 downloaded and verified

Running "_build:extractNodeBuilds" task

Running "copy:devSource" (copy) task
Created 483 directories, copied 2032 files

Running "clean:devSourceForTestbed" (clean) task

1 path cleaned.

Running "babel:build" (babel) task

Running "_build:babelOptions" task

Running "_build:plugins" task

Running "_build:data" task

Running "i18nextract:default_options" (i18nextract) task

Create file: build/i18n_extract/en.json
Statistics : empty: 47 (100%) / Updated: 0 / Deleted: 0 / New: 47

Running "_build:check" task

Running "_build:packageJson" task

Running "_build:readme" task

Running "_build:babelCache" task

Running "_build:installNpmDeps" task

Running "_build:notice" task
Fatal error: Path must be a string. Received true
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kibana@6.0.0-alpha2 build: grunt build "--rpm"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kibana@6.0.0-alpha2 build 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! /home/farya/.npm/_logs/2017-06-01T12_59_41_662Z-debug.log

and here is the log file o/p:

0 info it worked if it ends with ok
1 verbose cli [ '/home/farya/.nvm/versions/node/v6.10.2/bin/node',
1 verbose cli '/home/farya/.nvm/versions/node/v6.10.2/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build',
1 verbose cli '--',
1 verbose cli '--rpm' ]
2 info using npm@4.6.1
3 info using node@v6.10.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle kibana@6.0.0-alpha2~prebuild: kibana@6.0.0-alpha2
6 silly lifecycle kibana@6.0.0-alpha2~prebuild: no script for prebuild, continuing
7 info lifecycle kibana@6.0.0-alpha2~build: kibana@6.0.0-alpha2
8 verbose lifecycle kibana@6.0.0-alpha2~build: unsafe-perm in lifecycle true
9 verbose lifecycle kibana@6.0.0-alpha2~build: PATH: /home/farya/.nvm/versions/node/v6.10.2/lib/node_modules/npm/bin/node-gyp-bin:/home/farya/kibana/node_modules/.bin:/home/farya/.nvm/versions/node/v6.10.2/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/farya/.local/bin:/home/farya/bin:/home/farya/.nvm/versions/node/v6.10.2/bin/grunt
10 verbose lifecycle kibana@6.0.0-alpha2~build: CWD: /home/farya/kibana
11 silly lifecycle kibana@6.0.0-alpha2~build: Args: [ '-c', 'grunt build "--rpm"' ]
12 silly lifecycle kibana@6.0.0-alpha2~build: Returned: code: 1 signal: null
13 info lifecycle kibana@6.0.0-alpha2~build: Failed to exec build script
14 verbose stack Error: kibana@6.0.0-alpha2 build: grunt build "--rpm"
14 verbose stack Exit status 1

Hmm... Nothing in the output or error log seems to help. I am unable to reproduce it on my end as well.

Would you mind editing your tasks/build/notice.js file and adding a debugging statement? Specifically, could you add console.log({ kibanaDir, noticePath }); after line 22 where noticePath is initialized? Then run npm run build -- --rpm again and paste here the output of that debugging statement.

Thanks!

hi@shaunak,
I followed your suggestion.....and i got the error below:
[farya@kibanasgpl kibana]$ npm run build -- --rpm

kibana@6.0.0-alpha2 build /home/farya/kibana
grunt build "--rpm"

Running "build" task

Running "clean:build" (clean) task

1 path cleaned.

Running "clean:target" (clean) task

0 paths cleaned.

Running "_build:downloadNodeBuilds" task

Downloading darwin-x86_64 and corresponding sha
Downloading linux-x86_64 and corresponding sha
Downloading windows-x86_64 and corresponding sha
darwin-x86_64 downloaded and verified
linux-x86_64 downloaded and verified
windows-x86_64 downloaded and verified

Running "_build:extractNodeBuilds" task

Running "copy:devSource" (copy) task
Created 483 directories, copied 2032 files

Running "clean:devSourceForTestbed" (clean) task

1 path cleaned.

Running "babel:build" (babel) task

Running "_build:babelOptions" task

Running "_build:plugins" task

Running "_build:data" task

Running "i18nextract:default_options" (i18nextract) task

Create file: build/i18n_extract/en.json
Statistics : empty: 47 (100%) / Updated: 0 / Deleted: 0 / New: 47

Running "_build:check" task

Running "_build:packageJson" task

Running "_build:readme" task

Running "_build:babelCache" task

Running "_build:installNpmDeps" task

Running "_build:notice" task
{ kibanaDir: '/home/farya/kibana/build/kibana',
noticePath: '/home/farya/kibana/build/kibana/NOTICE.txt' }
Fatal error: Path must be a string. Received true
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kibana@6.0.0-alpha2 build: grunt build "--rpm"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kibana@6.0.0-alpha2 build 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! /home/farya/.npm/_logs/2017-06-01T15_16_28_153Z-debug.log

@shaunak....the edited notice.js file (as per your suggestion) is below:
import { resolve } from 'path';

import {
getInstalledPackages,
generateNoticeText,
} from '../lib';

async function generate(grunt, directory) {
return await generateNoticeText({
packages: await getInstalledPackages({
directory,
licenseOverrides: grunt.config.get('licenses.options.overrides')
}),
nodeDir: grunt.config.get('platforms')[0].nodeDir
});
}

export default function (grunt) {
grunt.registerTask('_build:notice', 'Adds a notice', function () {
const done = this.async();
const kibanaDir = resolve(grunt.config.get('buildDir'), 'kibana');
const noticePath = resolve(kibanaDir, 'NOTICE.txt');
console.log({ kibanaDir, noticePath });

generate(grunt, kibanaDir).then(
  (noticeText) => {
    grunt.file.write(noticePath, noticeText);
    done();
  },
  (error) => {
    grunt.fail.fatal(error);
    done(error);
  }
);

});
}

Logs of the /home/farya/.npm/_logs/2017-06-01T15_16_28_153Z-debug.log::

0 info it worked if it ends with ok
1 verbose cli [ '/home/farya/.nvm/versions/node/v6.10.2/bin/node',
1 verbose cli '/home/farya/.nvm/versions/node/v6.10.2/bin/npm',
1 verbose cli 'run',
1 verbose cli 'build',
1 verbose cli '--',
1 verbose cli '--rpm' ]
2 info using npm@4.6.1
3 info using node@v6.10.2
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle kibana@6.0.0-alpha2~prebuild: kibana@6.0.0-alpha2
6 silly lifecycle kibana@6.0.0-alpha2~prebuild: no script for prebuild, continuing
7 info lifecycle kibana@6.0.0-alpha2~build: kibana@6.0.0-alpha2
8 verbose lifecycle kibana@6.0.0-alpha2~build: unsafe-perm in lifecycle true
9 verbose lifecycle kibana@6.0.0-alpha2~build: PATH: /home/farya/.nvm/versions/node/v6.10.2/lib/node_modules/npm/bin/node-gyp-bin:/home/farya/kibana/node_modules/.bin:/home/farya/.nvm/versions/node/v6.10.2/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/farya/.local/bin:/home/farya/bin:/home/farya/.nvm/versions/node/v6.10.2/bin/grunt
10 verbose lifecycle kibana@6.0.0-alpha2~build: CWD: /home/farya/kibana
11 silly lifecycle kibana@6.0.0-alpha2~build: Args: [ '-c', 'grunt build "--rpm"' ]
12 silly lifecycle kibana@6.0.0-alpha2~build: Returned: code: 1 signal: null
13 info lifecycle kibana@6.0.0-alpha2~build: Failed to exec build script
14 verbose stack Error: kibana@6.0.0-alpha2 build: grunt build "--rpm"
14 verbose stack Exit status 1

Thanks, unfortunately that didn't help much either :frowning:

Hmm... I'm stumped as to why this is happening. I asked a few other folks on my team and one of them suggested a possible workaround: could you try rm -rf node_modules, then npm installagain, and then running npm run build -- --rpm?

@shaunak, I got the same error...after running those two commands:
npm run build -- --rpm

kibana@6.0.0-alpha2 build /home/farya/kibana
grunt build "--rpm"

Running "build" task

Running "clean:build" (clean) task

1 path cleaned.

Running "clean:target" (clean) task

0 paths cleaned.

Running "_build:downloadNodeBuilds" task

Downloading linux-x86_64 and corresponding sha
Downloading windows-x86_64 and corresponding sha
Downloading darwin-x86_64 and corresponding sha
darwin-x86_64 downloaded and verified
linux-x86_64 downloaded and verified
windows-x86_64 downloaded and verified

Running "_build:extractNodeBuilds" task

Running "copy:devSource" (copy) task
Created 483 directories, copied 2032 files

Running "clean:devSourceForTestbed" (clean) task

1 path cleaned.

Running "babel:build" (babel) task

Running "_build:babelOptions" task

Running "_build:plugins" task

Running "_build:data" task

Running "i18nextract:default_options" (i18nextract) task

Create file: build/i18n_extract/en.json
Statistics : empty: 47 (100%) / Updated: 0 / Deleted: 0 / New: 47

Running "_build:check" task

Running "_build:packageJson" task

Running "_build:readme" task

Running "_build:babelCache" task

Running "_build:installNpmDeps" task

Running "_build:notice" task
Fatal error: Path must be a string. Received true
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kibana@6.0.0-alpha2 build: grunt build "--rpm"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the kibana@6.0.0-alpha2 build 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! /home/farya/.npm/_logs/2017-06-01T16_08_54_544Z-debug.log

1 Like

Hi Shaunak,
Please let me know if you get any chance to look into this issue.

1 Like

can anyone guide us on this?

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.