【问题标题】:An error occurred while running subprocess npm运行子进程 npm 时出错
【发布时间】:2021-07-24 06:01:57
【问题描述】:

当我尝试启动一个新的 ionic 项目时发生错误

我尝试重新安装 npm、node、ionic、清理 npm 缓存 npm 缓存验证] npm 缓存清理 --force

错误代码:

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm ERR! Unexpected token : in JSON at position 260218 while parsing near '...RA9TVsSAnZWagAAGRgm":"d262c5b83aa5cf4386...'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lucas\AppData\Roaming\npm-cache\_logs\2021-04-30T23_24_15_632Z-debug.log
[ERROR] An error occurred while running subprocess npm.

        npm.cmd i exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

日志:

4108 verbose Windows_NT 10.0.21370 4109 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" 4110 verbose node v14.16.1 4111 verbose npm v6.14.12 4112 error Unexpected token : in JSON at position 260218 while parsing near '...RA9TVsSAnZWagAAGRgm":"d262c5b83aa5cf4386...' 4113 verbose exit [ 1, true ]

【问题讨论】:

    标签: node.js ionic-framework npm


    【解决方案1】:

    您可以在发布的日志中找到答案。

    npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
    

    verbose node v14.16.1 4111 
    

    通过卸载当前版本或使用 nvm 降级到小于 14 的节点版本。我个人喜欢using nmv.

    【讨论】:

      猜你喜欢
      • 2019-08-27
      • 1970-01-01
      • 2020-04-23
      • 2018-11-22
      • 2015-09-02
      • 1970-01-01
      • 2021-12-04
      • 1970-01-01
      相关资源
      最近更新 更多