简体   繁体   English

npm发布卡住(使用纱线)

[英]npm publish stuck (using yarn)

I'm trying to publish a new package. 我正在尝试发布一个新包。 I'm using ES6, so I'm first transpiling my files using babel. 我正在使用ES6,所以我首先使用babel来转换我的文件。

I'm stuck on this step: 我坚持这一步:

在此输入图像描述

This takes forever (waited more than an hour). 这需要永远(等待一个多小时)。 No error messages, nothing happens. 没有错误消息,没有任何反应。

Here's my package.json prepublish script and main.js: 这是我的package.json预发布脚本和main.js:

  "scripts": {
    "prepublish": "babel -d lib/ src/"
  }
  "main": "./lib/index.js"

My index.js has some ES6 imports and one module.export. 我的index.js有一些ES6导入和一个module.export。 Here's my .npmignore file: 这是我的.npmignore文件:

src/
yarn.lock
node_modules

I dont have any big filex in the directory (whole directory excluding node_modules has less than 1MB). 我在目录中没有任何大的filex(整个目录不包括node_modules小于1MB)。

Thanks for any tips! 谢谢你的任何提示!

As suggested by Shawn Erquhart, this is not an npm issue. 正如Shawn Erquhart所说,这不是一个npm问题。 It's caused by yarn package manager that I am using. 这是由我使用的纱线包经理造成的。

Related yarn issues: 相关纱线问题:

https://github.com/yarnpkg/yarn/issues/1494 https://github.com/yarnpkg/yarn/issues/1494

https://github.com/yarnpkg/yarn/issues/610 https://github.com/yarnpkg/yarn/issues/610

https://github.com/yarnpkg/yarn/issues/1694 https://github.com/yarnpkg/yarn/issues/1694

I fixed it by using npm instead of yarn. 我用npm代替纱线来修复它。 (Had to reinstall node since npm wasn't recognized as a bash(CLI) command after installing yarn). (必须重新安装节点,因为在安装yarn之后,npm未被识别为bash(CLI)命令)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM