npm安装后脚本中的问题

问题描述 投票:0回答:1

想在项目目录中运行流星,但是npm没有在目录中正确安装。npm安装后脚本中存在一些错误。我的项目基于Linux,但由于问题,我不得不从Windows运行服务器。React Native支持前端,MongoDB支持后端。每次我尝试在项目目录中安装npm时,都会显示以下错误。

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! [email protected] postinstall: `node .scripts/npm-postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm meteor npm-install npm-scripts post-install
1个回答
0
投票

似乎在安装后脚本上失败。有关如何禁用它的一些想法,请参见此响应。 npm: disable postinstall script for package

否则,您可以尝试使用yarn,因为它不执行安装后脚本。它的运行速度也更快。只要您的节点版本与流星节点版本匹配,就可以安全地使用yarn]

© www.soinside.com 2019 - 2024. All rights reserved.