npmmeteornpm-installnpm-scriptspost-install

Issues in npm post-install script


Want to run meteor in project directory, but npm is not getting installed properly in directory. There is some error in npm post-install script. My project is based on Linux but due to issues i have to run the server from windows. Front end is supported by React Native and Backend is supported by MongoDB. Everytime i try to install npm in project directory it shows following error.

Running npm-postinstall.js
child_process.js:669
    throw err;
    ^

Error: Command failed: copy node_modules/katex/dist/katex.min.css app/katex/
    at checkExecSyncError (child_process.js:630:11)
    at execSync (child_process.js:666:15)
    at Object.<anonymous> (D:\Project\Server\.scripts\npm-postinstall.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer 54 68 65 20 73 79 6e 74 61 78 20 6f 66 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 69 73 20 69 6e 63 6f 72 72 65 63 74 2e 0d 0a>,
    <Buffer >
  ],
  pid: 820,
  stdout: <Buffer 54 68 65 20 73 79 6e 74 61 78 20 6f 66 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 69 73 20 69 6e 63 6f 72 72 65 63 74 2e 0d 0a>,
  stderr: <Buffer >
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Rocket.Chat@3.3.0-develop postinstall: `node .scripts/npm-postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Rocket.Chat@3.3.0-develop postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Solution

  • It looks like it's failing on a post installation script. See this response for some ideas on how to disable it. npm: disable postinstall script for package

    Otherwise you can try using yarn instead, as it doesn't execute post install scripts. It also runs a bit quicker. As long as your node version matches the meteor node version, it should be safe to use yarn