npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Npm publish hangs on prepack

What I Wanted to Do

I wanted to publish a package on npm. I’ve already done npm adduser and I’m currently authenticated.

What Happened Instead

Npm hangs on the powershell
I’m on windows 10, node 10.14.1 and npm 6.4.1

Reproduction Steps

I just did npm publish --loglevel silly and this is the result (it hangs on prepack):

npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Users\\Giacomo\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'publish',
npm verb cli   '--loglevel',
npm verb cli   'silly' ]
npm info using npm@6.4.1
npm info using node@v10.14.1
npm verb npm-session 6b04efc8ae68a9b5
npm verb publish [ '.' ]
npm info lifecycle react-native-fab-pie@1.0.0~prepublish: react-native-fab-pie@1.0.0
npm info lifecycle react-native-fab-pie@1.0.0~prepare: react-native-fab-pie@1.0.0
npm info lifecycle react-native-fab-pie@1.0.0~prepublishOnly: react-native-fab-pie@1.0.0
npm info lifecycle react-native-fab-pie@1.0.0~prepack: react-native-fab-pie@1.0.0
[..................] | : info lifecycle react-native-fab-pie@1.0.0~prepack: react-native-fab-pie@1.0.0


Platform Info

$ npm --versions
{ 'react-native-fab-pie': '1.0.0',
  npm: '6.4.1',
  ares: '1.14.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.14.1',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '',
  zlib: '1.2.11' }
$ node -p process.platform

npm pack doesn’t work too

What are your run scripts

Yeah, I wanted to share the package.json but I was in doubt because it wasn’t written in the issue template

  "name": "react-native-fab-pie",
  "version": "1.0.0",
  "description": "Library to draw animated pie charts. Built with React Native ART + d3 and native animations.",
  "main": "src/index.js",
  "directories": {
    "example": "example"
  "scripts": {
    "test": "test",
    "lint": "prettier --write ./src/*.js"
  "husky": {
    "hooks": {
      "pre-commit": "npm run lint"
  "repository": {
    "type": "git",
    "url": "git+"
  "keywords": [
  "author": "Giacomo Cerquone",
  "license": "MIT",
  "bugs": {
    "url": ""
  "homepage": "",
  "dependencies": {
    "d3-shape": "1.2.2"
  "devDependencies": {
    "babel-eslint": "^10.0.1",
    "babel-preset-expo": "^5.0.0",
    "eslint": "^5.9.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-prettier": "^3.3.0",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.1.2",
    "eslint-plugin-prettier": "^3.0.0",
    "eslint-plugin-react": "^7.11.1",
    "husky": "^1.2.0",
    "prettier": "1.15.3",
    "react": "16.5.0",
    "react-native": "0.57.4"
  "peerDependencies": {
    "react": "*",
    "react-native": "*"

tried to remove script and husky, but the problem remains

UPDATE: tried to give npm init to an empty new folder and it works, so there must be something strange with this folder.

I should have specified that the module is composed in this way:

could be that?

UPDATE: deleting the node_modules folder I was able to publish the module. Why so?

No clue. Something may have gotten messed up ig. :\

Ok, so it’s officially a bug. I think we can convert this issue to a bug.

Basically if you have something like an “example” folder in a npm package and that example folder has a package.json that points to the parent package (with: “file:…” as I said), it hangs on prepack, but if you remove the node_modules folder, it works!

Do you mean this, because I get an error there:

$ npm ini -y
$ mkdir a
$ cd a
$ npm ini -y
$ npm i ../
$ cd ..
$ npm pack
npm ERR! path /home/larsgw/Projects/Testing/
npm ERR! code ELOOP
npm ERR! errno -40
npm ERR! syscall stat
npm ERR! ELOOP: too many symbolic links encountered, stat '/home/larsgw/Projects/Testing/'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/larsgw/.npm/_logs/2018-12-04T22_47_55_905Z-debug.log