'Github action: NPM CI error: nice-napi not accessible from piscina
I've created a simple Github action for build and execute tests on each pull request. After no code changes, suddenly, stopped working. This is the actual action code:
name: Test pull request
on:
pull_request:
branches: [ develop ]
paths-ignore:
- 'apps/test/**'
- 'apps/test-e2e/**'
- 'libs/angular/**'
jobs:
test_server_pull_request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: 12
- run: npm ci
(...more build commands)
The package.json is actually this one, actually the project is a monorepo managed with NX, with some libraries and a NestJS server application and an Angular PWA:
{
"name": "sample",
"version": "0.0.1",
"license": "MIT",
"engines": {
"node": "12"
},
"scripts": {
....some scripts
},
"private": true,
"dependencies": {
"@angular/animations": "12.2.0",
"@angular/cdk": "12.2.0",
"@angular/common": "12.2.0",
"@angular/compiler": "12.2.0",
"@angular/core": "12.2.0",
"@angular/fire": "7.0.0",
"@angular/forms": "12.2.0",
"@angular/material": "12.2.0",
"@angular/platform-browser": "12.2.0",
"@angular/platform-browser-dynamic": "12.2.0",
"@angular/router": "12.2.0",
"@angular/service-worker": "12.2.0",
"@google-cloud/logging": "9.6.0",
"@nestjs/axios": "0.0.1",
"@nestjs/common": "8.0.6",
"@nestjs/config": "1.0.1",
"@nestjs/core": "8.0.6",
"@nestjs/platform-express": "8.0.6",
"@nrwl/angular": "12.6.5",
"class-transformer": "0.4.0",
"class-validator": "0.13.1",
"cls-hooked": "4.2.2",
"cookie-parser": "1.4.5",
"date-fns": "2.23.0",
"fast-xml-parser": "3.20.0",
"firebase": "9.0.0",
"firebase-admin": "9.11.1",
"firebase-functions": "3.15.4",
"flat": "5.0.2",
"helmet": "4.6.0",
"lodash": "4.17.21",
"nanoid": "3.1.25",
"reflect-metadata": "0.1.13",
"rxfire": "6.0.0",
"rxjs": "7.3.0",
"tslib": "2.0.0",
"zone.js": "0.11.4"
},
"devDependencies": {
"@angular-builders/custom-webpack": "12.1.0",
"@angular-devkit/architect": "0.1200.0",
"@angular-devkit/build-angular": "12.2.0",
"@angular-eslint/eslint-plugin": "12.3.1",
"@angular-eslint/eslint-plugin-template": "12.3.1",
"@angular-eslint/template-parser": "12.3.1",
"@angular/cli": "12.2.0",
"@angular/compiler-cli": "12.2.0",
"@angular/language-service": "12.2.0",
"@firebase/rules-unit-testing": "2.0.0",
"@firebase/testing": "0.20.11",
"@nestjs/schematics": "8.0.2",
"@nestjs/swagger": "5.0.9",
"@nestjs/testing": "8.0.6",
"@nrwl/cli": "12.6.5",
"@nrwl/eslint-plugin-nx": "12.6.5",
"@nrwl/jest": "12.6.5",
"@nrwl/linter": "12.6.5",
"@nrwl/nest": "12.6.5",
"@nrwl/node": "12.6.5",
"@nrwl/tao": "12.6.5",
"@nrwl/workspace": "12.6.5",
"@types/cls-hooked": "4.3.3",
"@types/cookie-parser": "1.4.2",
"@types/flat": "5.0.2",
"@types/jest": "26.0.24",
"@types/node": "14.14.33",
"@types/supertest": "2.0.11",
"@typescript-eslint/eslint-plugin": "3.9.1",
"@typescript-eslint/parser": "3.8.0",
"copy-webpack-plugin": "9.0.1",
"dotenv": "10.0.0",
"eslint": "7.22.0",
"eslint-config-google": "0.14.0",
"eslint-config-prettier": "8.1.0",
"eslint-plugin-import": "2.22.0",
"firebase-functions-test": "0.3.2",
"firebase-tools": "9.16.6",
"fuzzy": "0.1.3",
"inquirer": "6.2.2",
"inquirer-autocomplete-prompt": "1.0.1",
"jest": "27.0.3",
"jest-preset-angular": "9.0.4",
"jsonc-parser": "3.0.0",
"ng-packagr": "12.1.0",
"open": "7.0.3",
"prettier": "2.3.2",
"rimraf": "3.0.2",
"supertest": "6.1.4",
"swagger-ui-express": "4.1.6",
"ts-essentials": "7.0.3",
"ts-jest": "27.0.4",
"ts-node": "9.1.1",
"type-fest": "2.3.2",
"typescript": "4.3.5",
"webpack": "5.47.0",
"webpack-merge": "5.8.0",
"webpack-node-externals": "3.0.0"
}
}
I always get this error:
Run npm ci
npm ERR! nice-napi not accessible from piscina
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-09-28T17_52_55_162Z-debug.log
Error: Process completed with exit code 1.
Deleting and recreating the package.json did not solve, any idea?
Solution 1:[1]
I resolved this error by updating my nodeJs to v16 and npm to v8 in my Build environment.
My local environment sneakily upgraded to these versions while my build environment (Jenkins Nodes) stayed on node-v14 and npm-v6 causing this error with the new package-lock structure.
Solution 2:[2]
Replace
server.send(join.encode('utf-8'))
by
clientConnected.send(join.encode('utf-8'))
check Python TCP Communication for further details
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | monomo |
Solution 2 | David |