我正在尝试发布一个新包。 我使用的是 ES6,所以我首先使用 babel 转译我的文件。
我卡在这一步了:
这需要很长时间(等了一个多小时)。没有错误消息,没有任何反应。
这是我的 package.json 预发布脚本和 main.js:
"scripts": {
"prepublish": "babel -d lib/ src/"
}
"main": "./lib/index.js"
我的 index.js 有一些 ES6 导入和一个 module.export。 这是我的 .npmignore 文件:
src/
yarn.lock
node_modules
目录中没有任何大的 filex(除 node_modules 之外的整个目录不到 1MB)。
感谢任何提示!
最佳答案
正如 Shawn Erquhart 所建议的,这不是 npm 问题。这是由我正在使用的 yarn 包管理器引起的。
相关 yarn 问题:
https://github.com/yarnpkg/yarn/issues/1494
https://github.com/yarnpkg/yarn/issues/610
https://github.com/yarnpkg/yarn/issues/1694
我使用 npm 而不是 yarn 修复了它。 (必须重新安装 Node ,因为在安装 yarn 后 npm 未被识别为 bash(CLI) 命令)。
关于javascript - npm 发布卡住(使用 yarn ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41284430/