【问题标题】:executing npm install causes fsevents error执行 npm install 导致 fsevents 错误
【发布时间】:2020-08-29 08:38:42
【问题描述】:

我使用无服务器创建了一个新的打字稿项目。当我尝试安装软件包时,我收到 fsevents 错误。下面是从创建项目到安装包的完整脚本

操作系统:mac npm:6.14.4 节点:12.16.3

stmf@ml0195091 services % sls create -t aws-nodejs-typescript
Serverless: Generating boilerplate...
 _______                             __
|   _   .-----.----.--.--.-----.----|  .-----.-----.-----.
|   |___|  -__|   _|  |  |  -__|   _|  |  -__|__ --|__ --|
|____   |_____|__|  \___/|_____|__| |__|_____|_____|_____|
|   |   |             The Serverless Application Framework
|       |                           serverless.com, v1.70.1
 -------'

Serverless: Successfully generated boilerplate for template: "aws-nodejs-typescript"
Serverless: NOTE: Please update the "service" property in serverless.yml with your service name
stmf@ml0195091 services % npm install
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
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 fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.

> fsevents@1.2.13 install /Users/stmf/Documents/development/esg/esg-data-api/services/node_modules/watchpack/node_modules/fsevents
> node install.js

gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: read ECONNRESET
gyp ERR! stack     at TLSWrap.onStreamRead (internal/stream_base_commons.js:205:27)
gyp ERR! System Darwin 19.4.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/stmf/Documents/development/esg/esg-data-api/services/node_modules/watchpack/node_modules/fsevents
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN services@1.0.0 No repository field.

added 420 packages from 305 contributors in 22.939s

【问题讨论】:

    标签: node.js typescript macos npm aws-serverless


    【解决方案1】:

    遇到类似问题,在 package.json 添加以下代码后重新运行 npm install/yarn install

    "resolutions": {
            "**/**/node-gyp": "5.0.0"
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-08
      • 2021-09-06
      • 1970-01-01
      • 2021-11-04
      • 2016-10-28
      • 2020-12-01
      • 1970-01-01
      相关资源
      最近更新 更多