Code Monkey home page Code Monkey logo

Comments (4)

PieterT2000 avatar PieterT2000 commented on June 13, 2024 1

@Deemoguse Thanks, that solved it for me!

from np.

aoifelee avatar aoifelee commented on June 13, 2024

I also see it hang, on the "Publishing package using Yarn Berry" step. I just started using np today, so it never worked for me previously. Also, I do not see the published package in npm.

np - 9.2.0
node - 20.10.0
yarn - 4.0.2
OS - macOS 14.1.1

from np.

Deemoguse avatar Deemoguse commented on June 13, 2024

@aoifelee, @holdenmatt I had the same problem and just now I was able to solve it. The problem was that in my package.json file had a publish script that was responsible for publishing the package. It was a mistake to give such a name for this script, because publish is one of the npm hooks that is executed after the package is published to the public.

Make sure that you haven't made the same mistake.

"scripts": {
	"eslint:fix": "eslint **/*.ts --fix --color",
	"build:prod": "rimraf dist & cross-env rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
	"build:test": "rimraf dist & cross-env MODE=test rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
	"test:modules": "jest --verbose --roots test/cases/modules",
	"test:integration": "jest --verbose --roots test/cases/integration",
	"test:perfomance": "jest --verbose --roots test/cases/perfomance",
	"test": "npm run build:test && npm run test:modules && npm run test:integration && npm run test:perfomance && rimraf dist",
-	"publish": "npm run test && npm run build:prod && np --no-tests"
+	"release": "npm run test && npm run build:prod && np --no-tests"
},

from np.

ericcarraway avatar ericcarraway commented on June 13, 2024

For me, the np command would hang indefinitely during the "Publishing package" step. I suspect the problem stemmed from my test script, which was inadvertently running in watch mode while publishing. To resolve this, I modified my npm scripts:

- "test": "vitest",
+ "test": "vitest run",
+ "test:dev": "vitest",

Adjusting the test command to vitest run now executes the tests once and exits, thus preventing the np command from hanging. I've added a test:dev script that retains the original watch mode functionality for development purposes.

This adjustment may help others experiencing similar issues with np hanging due to test scripts not terminating.

from np.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.