I saw an article about nba-go, a nodejs app for showing NBA football scores. Looks neat so I thought I’d test our nodejs plugin to see how it works. It fails to build. Here’s the error you get while building.
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 905 packages in 14.01s
npm --cache-min=Infinity install --global
npm ERR! path /root/build_nba-go/parts/nba-go/install/lib/node_modules/nba-go/lib/cli.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/root/build_nba-go/parts/nba-go/install/lib/node_modules/nba-go/lib/cli.js'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-11-07T12_28_26_448Z-debug.log
name: nba-go
version: '0.1.8'
summary: The finest NBA CLI
description: |
Watch NBA live play-by-play, game preview, box score and player information
on your console.
Best CLI tool for who is both a NBA fans and Engineer.
All data comes from stats.nba.com APIs..
confinement: strict
apps:
nba-go:
command: nba-go
plugs:
- network
parts:
nba-go:
plugin: nodejs
node-engine: '8.9.0'
source: https://github.com/xxhomey19/nba-go.git
source-tag: 'v0.1.8'
I tried without node-engine to use an older version initially, and tried building from tip of master, and with newer node. It fails the same way.
Interestingly I ran snapcraft cleanbuild --debug and while inside the lxc container I did apt install npm and npm install -g nba-go and it all installed okay. But I can’t get the snap to build.
I think this is a bug in nba-go upstream. The package.json references ./lib in multiple places but that folder does not exist in the repository. It looks like the author changed those references in this commit but didn’t change the folder structure to match.
Pulling nba-go
Downloading 'node-v6.10.2-linux-x64.tar.gz'[==================================================================] 100%
Downloading 'latest.tar.gz'[==================================================================================] 100%
/root/build_nba-go/parts/nba-go/npm/bin/yarn run build
yarn run v1.3.2
error Couldn't find a package.json file in "/root/build_nba-go/parts/nba-go/src"
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
oh, I am running this from a clone of the repo. If you are not, then you have to change the source: . to source: https://github.com/xxhomey19/nba-go.git
No, the problem is understood and won’t be fixed until portions of Multiple users and groups in snaps are implemented. This is something that is roadmapped but not prioritized. I’m working on it in the background to help out, so progress is being made, albeit slowly.
The options now are:
patch to not do the chown (chown really doesn’t make sense if your are non-root anyway)