In my Angular project I want to run automated test on every push on any branches with this YAML file:
on: [push]
jobs:
ng-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout#v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v1
with:
node-version: ${{ matrix.node-version }}
- name: npm ci
run: |
cd angular/
npm ci
- name: ng test
run: |
cd angular/
npm run test:ci
And the result is this:
Chrome Headless 96.0.4664.45 (Linux x86_64): Executed 18 of 23 (skipped 5) SUCCESS (0.817 secs / 0.519 secs)
TOTAL: 36 SUCCESS
TOTAL: 36 SUCCESS
TOTAL: 36 SUCCESS
=============================== Coverage summary ===============================
Statements : 32.12% ( 387/1205 )
Branches : 11.75% ( 53/451 )
Functions : 14.2% ( 45/317 )
Lines : 29.78% ( 341/1145 )
================================================================================
=============================== Coverage summary ===============================
Statements : 32.12% ( 387/1205 )
Branches : 11.75% ( 53/451 )
Functions : 14.2% ( 45/317 )
Lines : 29.78% ( 341/1145 )
================================================================================
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myproject#11.0.0 test:ci: `ng test --watch=false --code-coverage --source-map true`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myproject#11.0.0 test:ci script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-12-06T12_08_18_494Z-debug.log
Error: Process completed with exit code 1.
In my local machine everything is fine.
What's wrong here? Any idea?
Yarn Install successful:
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>yarn
yarn install v1.22.10
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
Done in 2.77s.
Yarn dist error:
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>yarn dist
yarn run v1.22.10
$ yarn build prod
$ node development/build/index.js prod
running task "prod"...
Starting 'prod'...
Starting 'clean'...
(node:12548) ExperimentalWarning: The fs.promises API is experimental
Finished 'clean'
Starting 'styles:prod'...
Finished 'styles:prod'
Starting 'scripts:deps:background'...
Starting 'scripts:deps:ui'...
Starting 'scripts:core:prod:background'...
Starting 'scripts:core:prod:ui'...
Starting 'scripts:core:prod:phishing-detect'...
Starting 'scripts:core:prod:contentscript'...
Starting 'static:prod'...
Starting 'manifest:prod'...
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn yarn ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
C:\Users\Yael\Downloads\metamask-extension-8.0.9\metamask-extension-8.0.9>
I am trying to install Gulp and gulp-util
This is what i am getting
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\nodejs\\node.exe',
1 verbose cli 'C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--save-dev',
1 verbose cli 'gulp-util' ]
2 info using npm#2.15.9
3 info using node#v4.6.0
4 verbose install initial load of C:\Users\icer\Desktop\github\coffeescript\project1\package.json
5 verbose stack Error: Invalid version: "1.0"
5 verbose stack at Object.module.exports.fixVersionField (C:\nodejs\node_modules\npm\node_modules\normalize-package-data\lib\fixer.js:191:13)
5 verbose stack at C:\nodejs\node_modules\npm\node_modules\normalize-package-data\lib\normalize.js:32:38
5 verbose stack at Array.forEach (native)
5 verbose stack at normalize (C:\nodejs\node_modules\npm\node_modules\normalize-package-data\lib\normalize.js:31:15)
5 verbose stack at final (C:\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:349:5)
5 verbose stack at then (C:\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:124:5)
5 verbose stack at ReadFileContext.<anonymous> (C:\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:295:20)
5 verbose stack at ReadFileContext.callback (C:\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16)
5 verbose stack at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:303:13)
6 verbose cwd C:\Users\icer\Desktop\github\coffeescript\project1
7 error Windows_NT 10.0.14393
8 error argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "gulp-util"
9 error node v4.6.0
10 error npm v2.15.9
11 error Invalid version: "1.0"
12 error If you need help, you may report this error at:
12 error <https://github.com/npm/npm/issues>
13 verbose exit [ 1, true ]
When I run npm version it's throwing up some errors. Here's the entire npm-debug.log file:
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'version' ]
2 info using npm#2.1.17
3 info using node#v0.10.35
4 verbose node symlink /usr/local/bin/node
5 verbose config Skipping project config: /Users/realph/.npmrc. (matches userconfig)
6 error version Bad package.json data undefined
7 verbose type unexpected_token
8 verbose stack SyntaxError: Unexpected token u
8 verbose stack at Object.parse (native)
8 verbose stack at /usr/local/lib/node_modules/npm/lib/version.js:36:19
8 verbose stack at evalmachine.<anonymous>:208:20
8 verbose stack at OpenReq.Req.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:141:5)
8 verbose stack at OpenReq.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:61:22)
8 verbose stack at Object.oncomplete (evalmachine.<anonymous>:108:15)
9 verbose cwd /Users/realph
10 error Darwin 14.0.0
11 error argv "node" "/usr/local/bin/npm" "version"
12 error node v0.10.35
13 error npm v2.1.17
14 error Unexpected token u
15 error If you need help, you may report this error at:
15 error <http://github.com/npm/npm/issues>
16 verbose exit [ 1, true ]
Not sure if it's got anything to do with changing my shell to zsh.
Any help is appreciated. Thanks in advance!
There are two issues here.
One is that there's a bug in recent versions of npm where npm version will error if package.json is missing or contains invalid data. https://github.com/npm/npm/issues/7056 That should be fixed with npm#2.2.0 which will officially be latest sometime later today. You can upgrade by following the appropriate instructions here https://github.com/npm/npm/wiki/Troubleshooting#try-the-latest-stable-version-of-npm
The second problem is that your package.json file can't be parsed - please check out the error message above:
Bad package.json data undefined
7 verbose type unexpected_token
8 verbose stack SyntaxError: Unexpected token u
You should inspect your package.json file to see if it is valid JSON http://www.json.org/ (which is a strict subset of javascript, identifier names must be double-quoted, etc.). You can run it through a validator at http://jsonlint.com/
I am new to what I'm doing now (Node.js,socket.io).
I've already installed Node.js and now I'm trying to install socket.io but I am having this EACCESS error. Thank you for the help!
I'm using Windows 7 x64
I ran cmd with privileges.
and then
npm install socket.io
Here is the log:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'socket.io' ]
2 info using npm#1.3.14
3 info using node#v0.10.22
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose cache add [ 'socket.io', null ]
6 verbose cache add name=undefined spec="socket.io" args=["socket.io",null]
7 verbose parsed url { protocol: null,
7 verbose parsed url slashes: null,
7 verbose parsed url auth: null,
7 verbose parsed url host: null,
7 verbose parsed url port: null,
7 verbose parsed url hostname: null,
7 verbose parsed url hash: null,
7 verbose parsed url search: null,
7 verbose parsed url query: null,
7 verbose parsed url pathname: 'socket.io',
7 verbose parsed url path: 'socket.io',
7 verbose parsed url href: 'socket.io' }
8 silly lockFile 71475bfd-socket-io socket.io
9 verbose lock socket.io C:\Users\Bobby\AppData\Roaming\npm-cache\71475bfd-socket- io.lock
10 silly lockFile 71475bfd-socket-io socket.io
11 silly lockFile 71475bfd-socket-io socket.io
12 verbose addNamed [ 'socket.io', '' ]
13 verbose addNamed [ null, '*' ]
14 silly lockFile c03de861-socket-io socket.io#
15 verbose lock socket.io# C:\Users\Bobby\AppData\Roaming\npm-cache\c03de861-socket- io.lock
16 silly addNameRange { name: 'socket.io', range: '*', hasData: false }
17 verbose url raw socket.io
18 verbose url resolving [ 'https://registry.npmjs.org/', './socket.io' ]
19 verbose url resolved https://registry.npmjs.org/socket.io
20 info trying registry request attempt 1 at 09:33:49
21 http GET https://registry.npmjs.org/socket.io
22 info retry will retry, error on last attempt: Error: connect EACCES
23 info trying registry request attempt 2 at 09:34:00
24 http GET https://registry.npmjs.org/socket.io
25 info retry will retry, error on last attempt: Error: connect EACCES
26 info trying registry request attempt 3 at 09:35:00
27 http GET https://registry.npmjs.org/socket.io
28 silly lockFile c03de861-socket-io socket.io#
29 silly lockFile c03de861-socket-io socket.io#
30 error Error: connect EACCES
30 error at errnoException (net.js:901:11)
30 error at Object.afterConnect [as oncomplete] (net.js:892:19)
30 error { [Error: connect EACCES] code: 'EACCES', errno: 'EACCES', syscall: 'connect' }
31 error Please try running this command again as root/Administrator.
32 error System Windows_NT 6.1.7601
33 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "socket.io"
34 error cwd C:\node
35 error node -v v0.10.22
36 error npm -v 1.3.14
37 error syscall connect
38 error code EACCES
39 error errno EACCES
40 error stack Error: connect EACCES
40 error stack at errnoException (net.js:901:11)
40 error stack at Object.afterConnect [as oncomplete] (net.js:892:19)
41 verbose exit [ 1, true ]
EACCES means socket.io can't access a port. It might be because you don't have the privileges or the port is already used by another application. You should run this command as an administrator and/or close any process using the port socket.io is trying to access to.
I think it's:
runas /noprofile /root:Administrator npm install socket.io