Npm publish hangs on prepack

cli
priority:low
triaged

(Giacomo Cerquone) #1

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: '6.8.275.32-node.36',
  zlib: '1.2.11' }
$ node -p process.platform
win32

(Giacomo Cerquone) #2

npm pack doesn’t work too


(Kat Marchán) #3

What are your run scripts


(Giacomo Cerquone) #4

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+https://github.com/giacomocerquone/react-native-fab-pie.git"
  },
  "keywords": [
    "react-native",
    "pie-chart",
    "animation",
    "art",
    "d3"
  ],
  "author": "Giacomo Cerquone",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/giacomocerquone/react-native-fab-pie/issues"
  },
  "homepage": "https://github.com/giacomocerquone/react-native-fab-pie#readme",
  "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.


(Giacomo Cerquone) #5

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

  • package.json
  • src (script’s package)
  • example
    – package.json (of the example, with a dep towards the upper module “file:…”)

could be that?

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


(Kat Marchán) #6

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


(Giacomo Cerquone) #7

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!


(Lars Willighagen) #8

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.community/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089
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.community/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089/a/node_modules/089'

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