Project

General

Profile

Bug #21418

npm postinstall fails

Added by Anonymous over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
JavaScript stack
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

In the DEB package build I saw the following:

13:20:11 npm WARN lifecycle TheForemanDevDeps@1.17.0~postinstall: cannot run in wd %s %s (wd=%s) TheForemanDevDeps@1.17.0 node ./script/npm_install_plugins.js /var/lib/workspace/workspace/packaging_build_deb_coreproject/arch/armv8/label/debian/os/xenial/debian/xenial/build-foreman/foreman-1.17.0

And on my workstation I'm getting:

$ npm install

> TheForemanDevDeps@1.17.0 postinstall /home/mmoll/mystuff/gitrepos/theforeman/foreman
> node ./script/npm_install_plugins.js

child_process.js:635
    throw err;
    ^

Error: Command failed: /home/mmoll/mystuff/gitrepos/theforeman/foreman/script/plugin_webpack_directories.rb
    at checkExecSyncError (child_process.js:592:13)
    at execSync (child_process.js:632:13)
    at webpackedDirs (/home/mmoll/mystuff/gitrepos/theforeman/foreman/script/plugin_webpack_directories.js:44:10)
    at getPluginDirs (/home/mmoll/mystuff/gitrepos/theforeman/foreman/script/plugin_webpack_directories.js:50:41)
    at packageJsonDirs (/home/mmoll/mystuff/gitrepos/theforeman/foreman/script/plugin_webpack_directories.js:54:37)
    at Object.<anonymous> (/home/mmoll/mystuff/gitrepos/theforeman/foreman/script/npm_install_plugins.js:6:1)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! TheForemanDevDeps@1.17.0 postinstall: `node ./script/npm_install_plugins.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the TheForemanDevDeps@1.17.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

tail of the log:

1786 verbose unlock done using /home/mmoll/.npm/_locks/staging-74de5aa0c3c5414e.lock for /home/mmoll/mystuff/gitrepos/theforeman/foreman/node_modules/.staging
1787 silly install runPostinstallTopLevelLifecycles
1788 silly build TheForemanDevDeps@1.17.0
1789 info linkStuff TheForemanDevDeps@1.17.0
1790 silly linkStuff TheForemanDevDeps@1.17.0 has /home/mmoll/mystuff/gitrepos/theforeman as its parent node_modules
1791 verbose linkBins TheForemanDevDeps@1.17.0
1792 verbose linkMans TheForemanDevDeps@1.17.0
1793 silly install TheForemanDevDeps@1.17.0
1794 info lifecycle TheForemanDevDeps@1.17.0~install: TheForemanDevDeps@1.17.0
1795 silly postinstall TheForemanDevDeps@1.17.0
1796 info lifecycle TheForemanDevDeps@1.17.0~postinstall: TheForemanDevDeps@1.17.0
1797 verbose lifecycle TheForemanDevDeps@1.17.0~postinstall: unsafe-perm in lifecycle true
1798 verbose lifecycle TheForemanDevDeps@1.17.0~postinstall: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/mmoll/mystuff/gitrepos/theforeman/foreman/node_modules/.bin:/home/mmoll/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/mmoll/.rvm/bin:/home/mmoll/bin:/home/mmoll/.rvm/bin
1799 verbose lifecycle TheForemanDevDeps@1.17.0~postinstall: CWD: /home/mmoll/mystuff/gitrepos/theforeman/foreman
1800 silly lifecycle TheForemanDevDeps@1.17.0~postinstall: Args: [ '-c', 'node ./script/npm_install_plugins.js' ]
1801 silly lifecycle TheForemanDevDeps@1.17.0~postinstall: Returned: code: 1  signal: null
1802 info lifecycle TheForemanDevDeps@1.17.0~postinstall: Failed to exec postinstall script
1803 verbose stack Error: TheForemanDevDeps@1.17.0 postinstall: `node ./script/npm_install_plugins.js`
1803 verbose stack Exit status 1
1803 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
1803 verbose stack     at emitTwo (events.js:125:13)
1803 verbose stack     at EventEmitter.emit (events.js:213:7)
1803 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
1803 verbose stack     at emitTwo (events.js:125:13)
1803 verbose stack     at ChildProcess.emit (events.js:213:7)
1803 verbose stack     at maybeClose (internal/child_process.js:927:16)
1803 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
1804 verbose pkgid TheForemanDevDeps@1.17.0
1805 verbose cwd /home/mmoll/mystuff/gitrepos/theforeman/foreman
1806 verbose Linux 4.13.0-1-amd64
1807 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" 
1808 verbose node v8.7.0
1809 verbose npm  v5.4.2
1810 error code ELIFECYCLE
1811 error errno 1
1812 error TheForemanDevDeps@1.17.0 postinstall: `node ./script/npm_install_plugins.js`
1812 error Exit status 1
1813 error Failed at the TheForemanDevDeps@1.17.0 postinstall script.
1813 error This is probably not a problem with npm. There is likely additional logging output above.
1814 verbose exit [ 1, true ]

standalone execution:

$ node script/npm_install_plugins.js 
child_process.js:635
    throw err;
    ^

Error: Command failed: /home/mmoll/mystuff/gitrepos/theforeman/foreman/script/plugin_webpack_directories.rb
    at checkExecSyncError (child_process.js:592:13)
    at execSync (child_process.js:632:13)
    at webpackedDirs (/home/mmoll/mystuff/gitrepos/theforeman/foreman/script/plugin_webpack_directories.js:44:10)
    at getPluginDirs (/home/mmoll/mystuff/gitrepos/theforeman/foreman/script/plugin_webpack_directories.js:50:41)
    at packageJsonDirs (/home/mmoll/mystuff/gitrepos/theforeman/foreman/script/plugin_webpack_directories.js:54:37)
    at Object.<anonymous> (/home/mmoll/mystuff/gitrepos/theforeman/foreman/script/npm_install_plugins.js:6:1)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)


Related issues

Related to Foreman - Feature #21180: Add 3rd party js libraries in pluginsClosed2017-10-03

Associated revisions

Revision 2e56d35d (diff)
Added by Michael Moll over 2 years ago

Fixes #21418 - run npm with unsafe-perm after bundle

History

#1 Updated by Anonymous over 2 years ago

  • Related to Feature #21180: Add 3rd party js libraries in plugins added

#2 Updated by Ohad Levy over 2 years ago

Did you run bundle before running npm? Webpack now require bundler so we are able to figure out which plugins are installed.

#3 Updated by Anonymous over 2 years ago

Did you run bundle before running npm?

That fixed my local problem, thanks.

I'll try to fix the DEB build problem by executing the npm install later in the process and we'll see, if that's sufficient.

#4 Updated by The Foreman Bot over 2 years ago

  • Assignee set to Anonymous
  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-packaging/pull/1880 added

#5 Updated by Anonymous over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#6 Updated by Marek Hulán over 2 years ago

  • Status changed from Closed to Resolved

Also available in: Atom PDF